Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for crash when function expression has empty body.
FAILURE: _(:<>(o;?(a(@([ [NoSuchMethodError: The getter 'contextType' was called on null. Receiver: null Tried calling: contextType, #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5) flutter#1 FunctionExpressionResolver.resolve (package:analyzer/src/dart/resolver/function_expression_resolver.dart:72:35) flutter#2 ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:1424:37) flutter#3 FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5004:49) flutter#4 ResolverVisitor.visitConditionalExpression (package:analyzer/src/generated/resolver.dart:1068:16) #5 ConditionalExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:2265:15) flutter#6 DefaultFormalParameterImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:3008:20) flutter#7 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1710:10) flutter#8 UnifyingAstVisitor.visitDefaultFormalParameter (package:analyzer/dart/ast/visitor.dart:3198:65) flutter#9 ResolverVisitor.visitDefaultFormalParameter (package:analyzer/src/generated/resolver.dart:1206:11) flutter#10 DefaultFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:3003:15) flutter#11 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20) flutter#12 FormalParameterListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4493:17) flutter#13 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1710:10) flutter#14 UnifyingAstVisitor.visitFormalParameterList (package:analyzer/dart/ast/visitor.dart:3258:59) flutter#15 ScopedVisitor.visitFormalParameterList (package:analyzer/src/generated/resolver.dart:2684:11) flutter#16 FormalParameterListImpl.accept (package:analyzer/src/dart/ast/ast.dart:4489:49) flutter#17 FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5009:18) flutter#18 FunctionExpressionResolver.resolve (package:analyzer/src/dart/resolver/function_expression_resolver.dart:65:10) flutter#19 ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:1415:35) flutter#20 FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5004:49) #21 FunctionDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4873:26) #22 ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:1710:10) #23 UnifyingAstVisitor.visitFunctionDeclaration (package:analyzer/dart/ast/visitor.dart:3271:59) #24 ScopedVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:2749:11) #25 ResolverVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:1405:11) #26 ScopedVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:2742:7) #27 ResolverVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:1374:11) #28 FunctionDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:4866:49) #29 ResolverVisitor.visitCompilationUnit (package:analyzer/src/generated/resolver.dart:1055:23) #30 CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2134:49) #31 LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:706:10) Change-Id: I62cde978d075bbafacb1b429e87049ca5d54d268 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175907 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
- Loading branch information