Skip to content

endToken.previous is null in FunctionExpressionInvocation #46150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scheglov opened this issue May 26, 2021 · 2 comments
Closed

endToken.previous is null in FunctionExpressionInvocation #46150

scheglov opened this issue May 26, 2021 · 2 comments
Assignees
Labels
analyzer-crash-report Issues which have been reported due to an analysis server crash legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@scheglov
Copy link
Contributor

It happens here.

Don't know on which code.
@stereotype441 you might have changed something related in the parser recently.

Thread 0 main thread_CastError: Null check operator used on a null value
at NodeLocator.visitNode(utilities.dart:2541)
at UnifyingAstVisitor.visitFunctionExpressionInvocation(visitor.dart:3363)
at FunctionExpressionInvocationImpl.accept(ast.dart:5006)
at ExpressionStatementImpl.visitChildren(ast.dart:3636)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitExpressionStatement(visitor.dart:3309)
at ExpressionStatementImpl.accept(ast.dart:3632)
at NodeListImpl.accept(ast.dart:7581)
at BlockImpl.visitChildren(ast.dart:1056)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitBlock(visitor.dart:3217)
at BlockImpl.accept(ast.dart:1052)
at BlockFunctionBodyImpl.visitChildren(ast.dart:1011)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitBlockFunctionBody(visitor.dart:3220)
at BlockFunctionBodyImpl.accept(ast.dart:1007)
at MethodDeclarationImpl.visitChildren(ast.dart:7016)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitMethodDeclaration(visitor.dart:3435)
at MethodDeclarationImpl.accept(ast.dart:7007)
at NodeListImpl.accept(ast.dart:7581)
at ClassDeclarationImpl.visitChildren(ast.dart:1530)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitClassDeclaration(visitor.dart:3235)
at ClassDeclarationImpl.accept(ast.dart:1500)
at NodeListImpl.accept(ast.dart:7581)
at CompilationUnitImpl.visitChildren(ast.dart:2091)
at NodeLocator.visitNode(utilities.dart:2550)
at UnifyingAstVisitor.visitCompilationUnit(visitor.dart:3247)
at CompilationUnitImpl.accept(ast.dart:2084)
at NodeLocator.searchWithin(utilities.dart:2511)
at BaseProcessor.findSelectedNode(base_processor.dart:47)
at AssistProcessor._containsErrorCode(assist_internal.dart:272)
at AssistProcessor._addFromProducers(assist_internal.dart:257)
at <asynchronous gap>(async)
at AssistProcessor.compute(assist_internal.dart:170)
at <asynchronous gap>(async)
at EditDomainHandler._computeServerAssists(edit_domain.dart:772)
at <asynchronous gap>(async)
at EditDomainHandler.getAssists(edit_domain.dart:223)
@scheglov scheglov added legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on analyzer-crash-report Issues which have been reported due to an analysis server crash labels May 26, 2021
@scheglov
Copy link
Contributor Author

I see it in internal crash reporting for about 10 users.

@stereotype441
Copy link
Member

Hmm, this was likely introduced in 126c5fa. In the case where type arguments are applied to an expression but there are no parentheses that follow, the AstBuilder introduces a synthetic pair of ( and ), but it doesn't put these synthetic parens in the token stream (see #46148 for more details about why)

I believe https://dart-review.googlesource.com/c/sdk/+/199682 should fix this particular issue. I'll get that cleaned up and sent out for review ASAP.

@stereotype441 stereotype441 self-assigned this May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-crash-report Issues which have been reported due to an analysis server crash legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

2 participants