File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1516,7 +1516,7 @@ class ResolverVisitor extends ScopedVisitor {
1516
1516
1517
1517
CollectionElement thenElement = node.thenElement;
1518
1518
if (_flowAnalysis != null ) {
1519
- _flowAnalysis.flow.ifStatement_thenBegin (condition);
1519
+ _flowAnalysis.flow? .ifStatement_thenBegin (condition);
1520
1520
thenElement.accept (this );
1521
1521
} else {
1522
1522
_promoteManager.visitIfElement_thenElement (
@@ -1556,7 +1556,7 @@ class ResolverVisitor extends ScopedVisitor {
1556
1556
1557
1557
Statement thenStatement = node.thenStatement;
1558
1558
if (_flowAnalysis != null ) {
1559
- _flowAnalysis.flow.ifStatement_thenBegin (condition);
1559
+ _flowAnalysis.flow? .ifStatement_thenBegin (condition);
1560
1560
visitStatementInScope (thenStatement);
1561
1561
nullSafetyDeadCodeVerifier? .flowEnd (thenStatement);
1562
1562
} else {
Original file line number Diff line number Diff line change @@ -395,6 +395,18 @@ var v = <T>();
395
395
''' );
396
396
}
397
397
398
+ test_inDefaultValue_noFlow_ifExpression () async {
399
+ await _assertCanBeAnalyzed ('''
400
+ typedef void F({a = [if (true) 0]});
401
+ ''' );
402
+ }
403
+
404
+ test_inDefaultValue_noFlow_ifStatement () async {
405
+ await _assertCanBeAnalyzed ('''
406
+ typedef void F([a = () { if (true) 0; }]);
407
+ ''' );
408
+ }
409
+
398
410
test_issue_40837 () async {
399
411
await _assertCanBeAnalyzed ('''
400
412
class A {
You can’t perform that action at this time.
0 commit comments