Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 7.0.2
Description
Consider this function:
function reduceViewProductHistoryDetail(state, backend, actionCreator, data) { // Set the currently viewed event. // Search in active product live events first, then in product history. for (let i = 0; i < state.activeProductLiveEvents.count; ++i) { const e = state.activeProductLiveEvents.get(i) if (e.mid === data.id) { state.detailEvent.fromJS(e) actionCreator.redirect(Const.Page.ProductHistoryDetail) return } } for (let i = 0; i < state.productHistory.count; ++i) { const e = state.productHistory.get(i) if (e.mid === data.id) { state.detailEvent.fromJS(e) actionCreator.redirect(Const.Page.ProductHistoryDetail) return } } }
The linter reports false positives for uses before declaration.
When you remove the second for loop, no warnings get emitted.
For the emitted warnings, see the attached screenshot