Navigation Menu

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

failing detecting type error (no error message), but subsequent importing the lib fails without error message #14497

Closed
DartBot opened this issue Oct 26, 2013 · 8 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@DartBot
Copy link

DartBot commented Oct 26, 2013

This issue was originally filed by nn...@gmail.com


What steps will reproduce the problem?
1.uncompress attached zip file
2.open sample_app/web/sample_common_generic_gui.dart in dart eclipse plugin, it does not recognize the importing class, Component from gui_component.
Also top dart file, sample_app/web/sample_dynamic_generic_gui.dart does not recognize element(yellow line)

  1. open /gui_component/lib/src/gui_generic_table.dart, and comment out a line:
    List<ComponentAction> get listeners => table.row_listeners;
    ==>
    // List<ComponentAction> get listeners => table.row_listeners;
  2. and uncomment
    //List<RowAction> get listeners => table.row_listeners;
    ==>
    List<RowAction> get listeners => table.row_listeners;

This fixes this reported problem.


What is the expected output? What do you see instead?
Should provide proper error messages when system fails to process program properly. I guess this is internal bug. This kind bug is hard to diagnose the cause of problem. and makes users skeptical for the overall quality of the system. Should be fixed with highest priority.

What version of the product are you using? On what operating system?
r28355 and r28984

Please provide any additional information below.

The mentioned problem is just one of them.

Sometimes, this cause bunch of weird problem.

  1. if we does not import using package, and use local path, it can succeed to import, but sometimes, even accessing packages using relative path for packages will fails, but if we create a link pointing to the same folder, it succeeds.

  2. having resolved importing issues this way(using relative path), and run the dart code, in certain context, 'a is A' becomes false even if a is instance of A, and a.runtimeType == A is evaluated to false. but in a simple context, it will be evaluated properly.

So essentially, failed compiled code seems processed twices?
The lack of error message makes it very hard to diagnose the real problem.

  1. this problem would have been introduced after r27778, since the same code did not cause these problems.

Attachment:
reflective_web_dev_kit.tar.gz (602.52 KB)

@floitschG
Copy link
Contributor

Added Area-Editor, Triaged labels.

@clayberg
Copy link

Added this to the Later milestone.
Removed Priority-Unassigned, Area-Editor labels.
Added Priority-Medium, Area-Analyzer labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@bwilkerson
Copy link
Member

I believe that the problem is that type resolution is trying to perform type substitution on a function type alias before the function type has had type resolution performed on it. Because type resolution hasn't been performed the parameter types are null, leading to the NPE.

Here's the stack trace:

com.google.dart.engine.context.AnalysisException: Exception
    at com.google.dart.engine.internal.task.AnalysisTask.safelyPerform(AnalysisTask.java:123)
    at com.google.dart.engine.internal.task.AnalysisTask.perform(AnalysisTask.java:73)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.cacheDartResolutionData(AnalysisContextImpl.java:2689)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.getDartResolutionData(AnalysisContextImpl.java:3428)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.getDartResolutionData(AnalysisContextImpl.java:3460)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.computeLibraryElement(AnalysisContextImpl.java:1234)
    at com.google.dart.engine.internal.resolver.Library.getLibraryElement(Library.java:249)
    at com.google.dart.engine.internal.resolver.LibraryResolver.buildDirectiveModels(LibraryResolver.java:465)
    at com.google.dart.engine.internal.resolver.LibraryResolver.resolveLibrary(LibraryResolver.java:297)
    at com.google.dart.engine.internal.task.ResolveDartLibraryTask.internalPerform(ResolveDartLibraryTask.java:97)
    at com.google.dart.engine.internal.task.AnalysisTask.safelyPerform(AnalysisTask.java:119)
    at com.google.dart.engine.internal.task.AnalysisTask.perform(AnalysisTask.java:73)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.cacheDartResolutionData(AnalysisContextImpl.java:2689)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.getDartResolutionData(AnalysisContextImpl.java:3428)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.getDartResolutionData(AnalysisContextImpl.java:3460)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.computeLibraryElement(AnalysisContextImpl.java:1234)
    at com.google.dart.engine.internal.resolver.Library.getLibraryElement(Library.java:249)
    at com.google.dart.engine.internal.resolver.LibraryResolver.buildDirectiveModels(LibraryResolver.java:465)
    at com.google.dart.engine.internal.resolver.LibraryResolver.resolveLibrary(LibraryResolver.java:297)
    at com.google.dart.engine.internal.task.ResolveDartLibraryTask.internalPerform(ResolveDartLibraryTask.java:97)
    at com.google.dart.engine.internal.task.AnalysisTask.safelyPerform(AnalysisTask.java:119)
    at com.google.dart.engine.internal.task.AnalysisTask.perform(AnalysisTask.java:73)
    at com.google.dart.engine.internal.context.AnalysisContextImpl.performAnalysisTask(AnalysisContextImpl.java:1917)
    at com.google.dart.tools.core.internal.builder.AnalysisWorker.performAnalysis(AnalysisWorker.java:386)
    at com.google.dart.tools.core.internal.builder.AnalysisManager.performAnalysis(AnalysisManager.java:148)
    at com.google.dart.tools.core.internal.builder.AnalysisManager$1.run(AnalysisManager.java:184)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
    at com.google.dart.engine.internal.type.TypeImpl.equalArrays(TypeImpl.java:82)
    at com.google.dart.engine.internal.type.FunctionTypeImpl.internalEquals(FunctionTypeImpl.java:561)
    at com.google.dart.engine.internal.type.FunctionTypeImpl.equals(FunctionTypeImpl.java:103)
    at java.util.Arrays.equals(Arrays.java:2392)
    at com.google.dart.engine.internal.type.InterfaceTypeImpl.substitute(InterfaceTypeImpl.java:653)
    at com.google.dart.engine.internal.type.InterfaceTypeImpl.substitute(InterfaceTypeImpl.java:1)
    at com.google.dart.engine.internal.type.FunctionTypeImpl.getReturnType(FunctionTypeImpl.java:266)
    at com.google.dart.engine.internal.resolver.TypeResolverVisitor.visitMethodDeclaration(TypeResolverVisitor.java:471)
    at com.google.dart.engine.internal.resolver.ScopedVisitor.visitMethodDeclaration(ScopedVisitor.java:1)
    at com.google.dart.engine.ast.MethodDeclaration.accept(MethodDeclaration.java:118)
    at com.google.dart.engine.internal.resolver.TypeResolverVisitor.visitClassMembersInScope(TypeResolverVisitor.java:862)
    at com.google.dart.engine.internal.resolver.ScopedVisitor.visitClassDeclaration(ScopedVisitor.java:271)
    at com.google.dart.engine.internal.resolver.TypeResolverVisitor.visitClassDeclaration(TypeResolverVisitor.java:274)
    at com.google.dart.engine.internal.resolver.ScopedVisitor.visitClassDeclaration(ScopedVisitor.java:1)
    at com.google.dart.engine.ast.ClassDeclaration.accept(ClassDeclaration.java:127)
    at com.google.dart.engine.ast.NodeList.accept(NodeList.java:67)
    at com.google.dart.engine.ast.CompilationUnit.visitChildren(CompilationUnit.java:216)
    at com.google.dart.engine.ast.visitor.UnifyingAstVisitor.visitNode(UnifyingAstVisitor.java:377)
    at com.google.dart.engine.ast.visitor.UnifyingAstVisitor.visitCompilationUnit(UnifyingAstVisitor.java:123)
    at com.google.dart.engine.ast.CompilationUnit.accept(CompilationUnit.java:110)
    at com.google.dart.engine.internal.resolver.LibraryResolver.buildTypeHierarchies(LibraryResolver.java:597)
    at com.google.dart.engine.internal.resolver.LibraryResolver.resolveLibrary(LibraryResolver.java:301)
    at com.google.dart.engine.internal.task.ResolveDartLibraryTask.internalPerform(ResolveDartLibraryTask.java:97)
    at com.google.dart.engine.internal.task.AnalysisTask.safelyPerform(AnalysisTask.java:119)
    ... 26 more


Added this to the 1.6 milestone.
Removed Priority-Medium, Oldschool-Milestone-Later labels.
Added Priority-High label.

@sethladd
Copy link
Contributor

Marked as High, assigning owner. If I get this wrong, please help me by:

* assigning a new owner

  • changing priority
  • changing milestone

Set owner to @bwilkerson.

@bwilkerson
Copy link
Member

Removed this from the 1.6 milestone.
Added this to the 1.7 milestone.

@bwilkerson
Copy link
Member

Added Started label.

@bwilkerson
Copy link
Member

https://codereview.chromium.org/594843006/ (bleeding edge revision 40693)


Added Fixed label.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Sep 25, 2014
@DartBot DartBot added this to the 1.7 milestone Sep 25, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

6 participants