Skip to content
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

DartNodeTraverser NPE in editor not in DartC #832

Closed
danrubel opened this issue Dec 13, 2011 · 8 comments
Closed

DartNodeTraverser NPE in editor not in DartC #832

danrubel opened this issue Dec 13, 2011 · 8 comments

Comments

@danrubel
Copy link

[user feedback]
The following code results in an NPE in the editor but not when running dartc:

library('lib');

class Foo {
}x

class Bar extends Foo {
 List<int> i;
}

void main() {
 new Test().run();
}

Removing 'x' after the curly brace removes the NPE.

[email protected]

////////////////////////////////////////////////////////////////////////////////////
Editor Version: 2374
OS: Linux
////////////////////////////////////////////////////////////////////////////////////

!ENTRY com.google.dart.tools.ui 4 10001 2011-12-13 14:28:07.018
!MESSAGE Internal Error
!STACK 1
Dart Model Exception: Core Exception [code 0] Failed to parse file:${user.home}/test/Test.dart
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:762)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Caused by: java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       ... 5 more
Caused by: org.eclipse.core.runtime.CoreException: Failed to parse file:${user.home}/test/Test.dart
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:763)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Caused by: java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       ... 5 more
!SUBENTRY 1 com.google.dart.tools.core 4 0 2011-12-13 14:28:07.023
!MESSAGE Failed to parse file:${user.home}/test/Test.dart
!STACK 0
java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)

!ENTRY com.google.dart.tools.ui 4 10001 2011-12-13 14:28:14.055
!MESSAGE Internal Error
!STACK 1
Dart Model Exception: Core Exception [code 0] Failed to parse file:${user.home}/test/Test.dart
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:762)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Caused by: java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       ... 5 more
Caused by: org.eclipse.core.runtime.CoreException: Failed to parse file:${user.home}/test/Test.dart
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:763)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)
Caused by: java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       ... 5 more
!SUBENTRY 1 com.google.dart.tools.core 4 0 2011-12-13 14:28:14.063
!MESSAGE Failed to parse file:${user.home}/test/Test.dart
!STACK 0
java.lang.NullPointerException
       at com.google.dart.compiler.ast.DartBinaryExpression.visitChildren(DartBinaryExpression.java:66)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExpression(DartNodeTraverser.java:67)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBinaryExpression(DartNodeTraverser.java:111)
       at com.google.dart.compiler.ast.DartBinaryExpression.accept(DartBinaryExpression.java:72)
       at com.google.dart.compiler.ast.DartExprStmt.visitChildren(DartExprStmt.java:31)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitExprStmt(DartNodeTraverser.java:191)
       at com.google.dart.compiler.ast.DartExprStmt.accept(DartExprStmt.java:36)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartBlock.visitChildren(DartBlock.java:44)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitStatement(DartNodeTraverser.java:71)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitBlock(DartNodeTraverser.java:116)
       at com.google.dart.compiler.ast.DartBlock.accept(DartBlock.java:49)
       at com.google.dart.compiler.ast.DartFunction.visitChildren(DartFunction.java:57)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitFunction(DartNodeTraverser.java:216)
       at com.google.dart.compiler.ast.DartFunction.accept(DartFunction.java:66)
       at com.google.dart.compiler.ast.DartMethodDefinition.visitChildren(DartMethodDefinition.java:85)
       at com.google.dart.compiler.ast.DartMethodDefinition$DartMethodWithInitializersDefinition.visitChildren(DartMethodDefinition.java:121)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitDeclaration(DartNodeTraverser.java:87)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitClassMember(DartNodeTraverser.java:91)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitMethodDefinition(DartNodeTraverser.java:276)
       at com.google.dart.compiler.ast.DartMethodDefinition.accept(DartMethodDefinition.java:90)
       at com.google.dart.compiler.ast.DartNodeTraverser.visit(DartNodeTraverser.java:413)
       at com.google.dart.compiler.ast.DartUnit.visitChildren(DartUnit.java:99)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitUnit(DartNodeTraverser.java:391)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:34)
       at com.google.dart.compiler.resolver.SupertypeResolver.exec(SupertypeResolver.java:27)
       at com.google.dart.compiler.DartCompiler$Compiler.resolveLibraries(DartCompiler.java:548)
       at com.google.dart.compiler.DartCompiler$Compiler.updateAndResolve(DartCompiler.java:218)
       at com.google.dart.compiler.DartCompiler$Compiler.access$4(DartCompiler.java:193)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1197)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:777)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:440)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:95)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:760)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:742)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:706)
       at com.google.dart.tools.ui.internal.text.editor.DartEditor.getAST(DartEditor.java:2010)
       at com.google.dart.tools.ui.internal.text.editor.DartTextHover.getHoverInfo(DartTextHover.java:46)
       at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:168)

@bwilkerson
Copy link
Member

Is this a bug in the compiler, or is there some option/state that Editor ought to be using that we're not?

I explored a little bit and the exception is occurring because there is a BinaryExpression whose left operand is null.

I'm not familiar with the command-line version. Does it try to resolve the code if there were syntax errors? (Just trying to guess why Editor is seeing this when the command-line tool isn't.)


Removed Area-Editor label.
Added Area-Compiler label.

@jtmcdole
Copy link
Contributor

DartC does not resolve if there were parse errors, it quits after reporting them.

@jtmcdole
Copy link
Contributor

Just noticed that we're not treating class as a reserved word, which snowballed in the parser to produce a bad AST in this case. Looking at now.


Set owner to @jtmcdole.
Added Accepted label.

@jtmcdole
Copy link
Contributor

There are still NPE's, but they appear to be due to a configuration issue. I honestly would like to see this not consume the "class" token and try to restart parsing from the top level.

http://codereview.chromium.org/8993011

@jtmcdole
Copy link
Contributor

Set owner to @danrubel.
Added Fixed label.

@jtmcdole
Copy link
Contributor

Added Accepted label.

@danrubel
Copy link
Author

Patched it in and works for me.


Set owner to @jtmcdole.

@jtmcdole
Copy link
Contributor

copybara-service bot pushed a commit that referenced this issue Dec 2, 2022
…, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

collection (https://github.com/dart-lang/collection/compare/efd709f..caf6802):
  caf6802  2022-11-28  Nate Bosch  Tweak docs for split extensions (#256)

fixnum (https://github.com/dart-lang/fixnum/compare/bca3816..62916f2):
  62916f2  2022-11-24  Lasse R.H. Nielsen  Split into separate libraries instead of using parts. (#97)
  14d4827  2022-11-23  Lasse R.H. Nielsen  Add `tryParse` methods. (#96)

http (https://github.com/dart-lang/http/compare/047d6ed..976bd56):
  976bd56  2022-11-28  Kevin Moore  Use latest mono_repo (#832)

protobuf (https://github.com/dart-lang/protobuf/compare/c181573..4f3e328):
  4f3e328  2022-11-30  Devon Carew  Emit imports in sorted order (#778)
  3cc088e  2022-11-28  Kevin Moore  Latest mono_repo (#779)

sse (https://github.com/dart-lang/sse/compare/8d018dd..d396145):
  d396145  2022-11-29  Elliott Brooks (she/her)  Fix Fetch credentials (#69)

stack_trace (https://github.com/dart-lang/stack_trace/compare/dce0013..cf3562e):
  cf3562e  2022-12-01  Devon Carew  blast_repo fixes (#123)

test (https://github.com/dart-lang/test/compare/b25dac9..f3d80a6):
  f3d80a68  2022-11-29  Nate Bosch  Fix missing label and reason after isNotNull (#1797)
  5b1f0075  2022-11-29  Nate Bosch  Use double quotes for test names on windows (#1802)
  986045c4  2022-11-29  Nate Bosch  Temporarily pin to ubuntu 20.04 (#1800)

webdev (https://github.com/dart-lang/webdev/compare/637b406..91b8a19):
  91b8a19  2022-12-01  Elliott Brooks (she/her)  Fix global variable `isInternalBuild` in injected client (#1805)
  7d0810a  2022-11-30  Elliott Brooks (she/her)  Updates the `fixture` package `pubspecs` so it is clear what shouldn't be migrated to null-safety
(#1803)
  acd3f9f  2022-11-30  Elliott Brooks (she/her)  Can debug with the MV3 Dart Debug Extension (#1802)
  1258510  2022-11-29  Elliott Brooks (she/her)  Detect whether the Debug Extension was built for dev or release (#1800)
  b4a23c6  2022-11-29  Elliott Brooks (she/her)  Fix Fetch API implementation (#1801)
  67133df  2022-11-29  Elliott Brooks (she/her)  Pull out debug logging into one file (#1799)
  a395c68  2022-11-28  Elliott Brooks (she/her)  Handle detecting Dart app when tab changes (#1796)
  4fb4328  2022-11-28  Elliott Brooks (she/her)  Authenticate the user when they click on the Dart Debug Extension icon (#1795)

Change-Id: I7beeeb43de4ba514817836ffd4ff6a62b801f2dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273282
Commit-Queue: Devon Carew <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
copybara-service bot pushed a commit that referenced this issue Dec 1, 2023
…ocess, vector_math, web, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

native (https://github.com/dart-lang/native/compare/0051e78..b5827f3):
  b5827f3b  2023-11-29  Daco Harkes  [infra] Hide TODOs from problems view in VSCode (#837)
  17487159  2023-11-29  Liam Appelbe  [ffigen] Only use `objc_msgSend` variants on x64 (#836)
  50b6a783  2023-11-28  Ryan Macnak  [native_toolchain_c] Setup Android RISCV64 toolchain. (#165)
  aa58de61  2023-11-28  Daco Harkes  [native] Bump deps (#834)
  6cf4c783  2023-11-28  Daco Harkes  [native_assets_builder] Only build native assets for dependencies of requested package (#833)
  f1221814  2023-11-28  Daco Harkes  [ffigen][infra] Use Apple silicon on CI (#832)

source_span (https://github.com/dart-lang/source_span/compare/ed16e0d..9398e24):
  9398e24  2023-11-29  Kevin Moore  Move to latest lints, require Dart 3.1 (#106)

stack_trace (https://github.com/dart-lang/stack_trace/compare/6496ff8..4abff44):
  4abff44  2023-11-29  Kevin Moore  Latest lints, require Dart ^3.1 (#146)

test_descriptor (https://github.com/dart-lang/test_descriptor/compare/c417cbb..59ce97f):
  59ce97f  2023-11-29  Kevin Moore  Bump and fix latest lints, require Dart 3.1 (#60)

test_process (https://github.com/dart-lang/test_process/compare/c21e40d..d68de5b):
  d68de5b  2023-11-29  Kevin Moore  Update lints, require Dart ^3.1 (#52)

vector_math (https://github.com/google/vector_math.dart/compare/e4066cc..cca3cf1):
  cca3cf1  2023-11-27  Devon Carew  Update README.md (#308)

web (https://github.com/dart-lang/web/compare/fdfbaef..cffc2e3):
  cffc2e3  2023-11-30  Devon Carew  parse spec info for generated libraries (#111)
  d902401  2023-11-29  Devon Carew  update the readme (#110)
  e5be5b3  2023-11-28  Devon Carew  delete previously generated files when generating (#108)

webdev (https://github.com/dart-lang/webdev/compare/6961b20..63e09e5):
  63e09e50  2023-11-30  Elliott Brooks  Remove unused scripting code and permission (#2294)
  8c225550  2023-11-29  Elliott Brooks  Prepare Dart Debug Extension for MV3 release (#2293)
  3bb4a6a6  2023-11-28  Elliott Brooks  Remove old code from before the new Dart Debug Extension (#2290)

Change-Id: Ia219625dce03494620a73272e8d1bde03e2e8aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339222
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants