File tree 2 files changed +19
-1
lines changed 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3999,7 +3999,7 @@ class ResolverVisitor extends ScopedVisitor {
3999
3999
_flowAnalysis.assignedVariables.capturedInNode (node),
4000
4000
identifierElement is VariableElement
4001
4001
? identifierElement
4002
- : loopVariable.declaredElement);
4002
+ : loopVariable? .declaredElement);
4003
4003
4004
4004
Statement body = node.body;
4005
4005
if (body != null ) {
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ import 'package:analyzer/dart/analysis/features.dart' ;
5
6
import 'package:analyzer/src/error/codes.dart' ;
7
+ import 'package:analyzer/src/generated/engine.dart' ;
6
8
import 'package:test_reflective_loader/test_reflective_loader.dart' ;
7
9
8
10
import '../dart/resolution/driver_resolution.dart' ;
9
11
10
12
main () {
11
13
defineReflectiveSuite (() {
12
14
defineReflectiveTests (UndefinedIdentifierTest );
15
+ defineReflectiveTests (UndefinedIdentifierWithNnbdTest );
13
16
});
14
17
}
15
18
@@ -147,3 +150,18 @@ class B extends A {
147
150
]);
148
151
}
149
152
}
153
+
154
+ @reflectiveTest
155
+ class UndefinedIdentifierWithNnbdTest extends UndefinedIdentifierTest {
156
+ @override
157
+ AnalysisOptionsImpl get analysisOptions => AnalysisOptionsImpl ()
158
+ ..contextFeatures = new FeatureSet .forTesting (
159
+ sdkVersion: '2.6.0' , additionalFeatures: [Feature .non_nullable]);
160
+
161
+ @failingTest
162
+ @override
163
+ test_forElement_inList_insideElement () async {
164
+ // todo: fails w/ StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
165
+ await super .test_forElement_inList_insideElement ();
166
+ }
167
+ }
You can’t perform that action at this time.
0 commit comments