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

Stack trace from editor evaluating code in CompileTimeConst visitor #327

Closed
DartBot opened this issue Nov 3, 2011 · 4 comments
Closed
Assignees

Comments

@DartBot
Copy link

DartBot commented Nov 3, 2011

This issue was originally filed by [email protected]


class Fooa {
 final Bara<Fooa> bar = const Bara/* <Fooa> Workaround bug #­322 */();
}

class Bar<T extends Fooa> {
 const Bara();
}

main1() {
 print(new Fooa());
}

========================================================================
com.google.dart.compiler.InternalCompilerException: Unexpected element
Bara kind: DYNAMIC evaluating type for compile-time constant
expression.
       at com.google.dart.compiler.resolver.CompileTimeConstVisitor.visitIdentifier(CompileTimeConstVisitor.java:304)
       at com.google.dart.compiler.resolver.CompileTimeConstVisitor.visitIdentifier(CompileTimeConstVisitor.java:1)
       at com.google.dart.compiler.ast.DartIdentifier.accept(DartIdentifier.java:78)
       at com.google.dart.compiler.ast.DartTypeNode.visitChildren(DartTypeNode.java:59)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitNode(DartNodeTraverser.java:54)
       at com.google.dart.compiler.ast.DartNodeTraverser.visitTypeNode(DartNodeTraverser.java:316)
       at com.google.dart.compiler.ast.DartTypeNode.accept(DartTypeNode.java:65)
       at com.google.dart.compiler.ast.DartNewExpression.visitChildren(DartNewExpression.java:61)
       at com.google.dart.compiler.resolver.CompileTimeConstVisitor.visitNewExpression(CompileTimeConstVisitor.java:341)
       at com.google.dart.compiler.resolver.CompileTimeConstVisitor.visitNewExpression(CompileTimeConstVisitor.java:1)
       at com.google.dart.compiler.ast.DartNewExpression.accept(DartNewExpression.java:67)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.checkConstantExpression(Resolver.java:349)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitField(Resolver.java:367)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitField(Resolver.java:1)
       at com.google.dart.compiler.ast.DartField.accept(DartField.java:78)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitClass(Resolver.java:232)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitClass(Resolver.java:1)
       at com.google.dart.compiler.ast.DartClass.accept(DartClass.java:175)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitUnit(Resolver.java:200)
       at com.google.dart.compiler.resolver.Resolver$ResolveElementsVisitor.visitUnit(Resolver.java:1)
       at com.google.dart.compiler.ast.DartUnit.accept(DartUnit.java:107)
       at com.google.dart.compiler.resolver.Resolver.exec(Resolver.java:112)
       at com.google.dart.compiler.resolver.Resolver$Phase.exec(Resolver.java:1380)
       at com.google.dart.compiler.DartCompiler.analyzeLibrary(DartCompiler.java:1179)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(DartCompilerUtilities.java:725)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$ResolverRunnable.run(DartCompilerUtilities.java:421)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities$CompilerRunner.runSafe(DartCompilerUtilities.java:92)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:708)
       at com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(DartCompilerUtilities.java:690)
       at com.google.dart.tools.core.internal.operation.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:126)
       at com.google.dart.tools.core.internal.operation.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:210)
       at com.google.dart.tools.core.internal.operation.DartModelOperation.run(DartModelOperation.java:374)
       at com.google.dart.tools.core.internal.operation.DartModelOperation.runOperation(DartModelOperation.java:441)
       at com.google.dart.tools.core.internal.model.CompilationUnitImpl.reconcile(CompilationUnitImpl.java:1357)
       at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy$1.run(DartReconcilingStrategy.java:159)
       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
       at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy.reconcile(DartReconcilingStrategy.java:134)
       at com.google.dart.tools.ui.internal.text.dart.DartReconcilingStrategy.reconcile(DartReconcilingStrategy.java:102)
       at com.google.dart.tools.ui.internal.text.functions.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:93)
       at com.google.dart.tools.ui.internal.text.functions.DartCompositeReconcilingStrategy.reconcile(DartCompositeReconcilingStrategy.java:120)
       at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
       at com.google.dart.tools.ui.internal.text.functions.DartReconciler.process(DartReconciler.java:387)
       at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)

@DartBot
Copy link
Author

DartBot commented Nov 4, 2011

This comment was originally written by [email protected]


Added Triaged label.

@DartBot
Copy link
Author

DartBot commented Nov 16, 2011

This comment was originally written by [email protected]


Changes in http://codereview.chromium.org/8523034/ may fix this problem, but I'm not sure until we integrate them into the editor.

There is a separate visitor (CompileTimeConstantResolver) which needs to run
after MemberBuilder is run on all units. Then, intead of being built into Resovler, the CompileTimeConstantAnalyzer runs separately.

@DartBot
Copy link
Author

DartBot commented Nov 28, 2011

This comment was originally written by [email protected]


for retest


Set owner to @stevemessick.

@stevemessick
Copy link
Contributor

Added Fixed label.

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

2 participants