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

unimplemented error using analyzer api #29759

Closed
MichaelRFairhurst opened this issue May 31, 2017 · 8 comments
Closed

unimplemented error using analyzer api #29759

MichaelRFairhurst opened this issue May 31, 2017 · 8 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@MichaelRFairhurst
Copy link
Contributor

MichaelRFairhurst commented May 31, 2017

Getting this analyzing a simple project. Can provide source if the exception isn't self explanatory

1496190636051:PluginEx:UnimplementedError:#0      CompilationUnitElementForLink.resolveTypeRef (package::analyzer/src/summary/link.dart::1099::7)
#1      CompilationUnitElementInDependency.getLinkedType (package::analyzer/src/summary/link.dart::1414::14)
#2      ParameterElementForLink.type (package::analyzer/src/summary/link.dart::4196::43)
#3      FunctionTypeImpl.parameters (package::analyzer/src/dart/element/type.dart::594::22)
#4      InstanceMemberInferrer._inferParameterCovariance.<anonymous closure> (package::analyzer/src/task/strong_mode.dart::458::66)
#5      Object&ListMixin.any (dart::collection/list.dart::115)
#6      InstanceMemberInferrer._inferParameterCovariance (package::analyzer/src/task/strong_mode.dart::457::51)
#7      InstanceMemberInferrer._inferExecutable (package::analyzer/src/task/strong_mode.dart::400::9)
#8      InstanceMemberInferrer._inferClass.<anonymous closure> (package::analyzer/src/task/strong_mode.dart::333::11)
#9      List.forEach (dart::core-patch/growable_array.dart::256)
#10     InstanceMemberInferrer._inferClass (package::analyzer/src/task/strong_mode.dart::332::30)
#11     InstanceMemberInferrer.inferCompilationUnit (package::analyzer/src/task/strong_mode.dart::107::9)
#12     CompilationUnitElementInBuildUnit.link (package::analyzer/src/summary/link.dart::1302::12)
#13     LibraryElementInBuildUnit.link (package::analyzer/src/summary/link.dart::3672::12)
#14     LibraryCycleNode.link (package::analyzer/src/summary/link.dart::3408::15)
#15     LibraryCycleDependencyWalker.evaluate (package::analyzer/src/summary/link.dart::3330::7)
#16     DependencyWalker.walk.strongConnect (package::front_end/src/dependency_walker.dart::149::13)
#17     DependencyWalker.walk (package::front_end/src/dependency_walker.dart::168::18)
#18     LibraryCycleForLink.ensureLinked (package::analyzer/src/summary/link.dart::3373::42)
#19     Linker.link (package::analyzer/src/summary/link.dart::3897::35)
#20     relink (package::analyzer/src/summary/link.dart::132::57)
#21     link (package::analyzer/src/summary/link.dart::113::3)
#22     new LibraryContext.forSingleLibrary.<anonymous closure>.<anonymous closure> (package::analyzer/src/dart/analysis/library_context.dart::116::27)
#23     PerformanceLog.run (package::front_end/src/base/performace_logger.dart::34::15)
#24     new LibraryContext.forSingleLibrary.<anonymous closure> (package::analyzer/src/dart/analysis/library_context.dart::115::14)
#25     PerformanceLog.run (package::front_end/src/base/performace_logger.dart::34::15)
#26     new LibraryContext.forSingleLibrary (package::analyzer/src/dart/analysis/library_context.dart::53::19)
#27     AnalysisDriver._createLibraryContext (package::analyzer/src/dart/analysis/driver.dart::1093::16)
#28     AnalysisDriver._computeUnitElement (package::analyzer/src/dart/analysis/driver.dart::1055::37)
#29     AnalysisDriver.performWork (package::analyzer/src/dart/analysis/driver.dart::791::34)
<asynchronous suspension>
#30     AnalysisDriverScheduler._run (package::analyzer/src/dart/analysis/driver.dart::1539::24)
<asynchronous suspension>
#31     AnalysisDriverScheduler.start (package::analyzer/src/dart/analysis/driver.dart::1482::5)
#32     new ServerPlugin (package::analyzer_plugin/plugin/plugin.dart::100::29)
#33     new AngularAnalysisPlugin (package::angular_analysis_plugin/plugin.dart::27::54)
#34     start (package::angular_analysis_plugin/starter.dart::13::15)
#35     main (file::///home/mfairhurst/.dartServer/.plugin_manager/5e7783dba3664f9579e65a27da9f9dd2/analysis_plugin/bin/plugin.dart::6::3)
#36     _startIsolate.<anonymous closure> (dart::isolate-patch/isolate_patch.dart::261)
#37     _RawReceivePortImpl._handleMessage (dart::isolate-patch/isolate_patch.dart::151)
@MichaelRFairhurst MichaelRFairhurst added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 31, 2017
@bwilkerson
Copy link
Member

@scheglov

@bwilkerson
Copy link
Member

@scheglov @stereotype441 This was left as a TODO in the code, and I'm not confident that I know what needs to be done here. If either of you knows, perhaps we can talk about it off-line.

@stereotype441
Copy link
Member

It's been long enough since I've worked on this code that I don't remember precisely what needs to be done, but I'd be glad to talk about it and help figure out.

@scheglov
Copy link
Contributor

scheglov commented May 31, 2017

@MichaelRFairhurst, Yes, it would be helpful to get source code. I think I saw this error once in logs, but was not able to reproduce it yet.

Hm... Or maybe I have been able?

@MichaelRFairhurst
Copy link
Contributor Author

Looks like the issue is with "Html5LibDomAdapter.on" which is in "project_root/.pub/deps/debug/angular2/lib/src/platform/server/html_adapter.dart".

I'm thinking I might just have to build pub again...Gonna zip that up first.

@scheglov
Copy link
Contributor

scheglov commented Jun 2, 2017

Hm... I was not able to reproduce the problem on Angular2 anymore.
But you're right, and I remember it now - the problem is actually with Html5LibDomAdapter.on.

But I was able to reproduce the problem with a test case.
We fail to notice that B.foo.bar has the function type, and the corresponding branch is not implemented in the linked unit. I think I will fix this, a bit later.

  void solo_test_inferredType_parameter_functionTyped() {
    var bundle = createPackageBundle(
        '''
class A {
  void foo(void bar(int arg)) {}
}
class B extends A {
  void foo(bar) {}
}
''',
        path: '/a.dart');
    addBundle('/a.ds', bundle);
    createLinker('''
import 'a.dart';
class C extends B {
  void foo(bar) {}
}
''');
    LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
    library.libraryCycleForLink.ensureLinked();
    ClassElementForLink_Class cls = library.getContainedName('C');
    expect(cls.methods, hasLength(1));
    MethodElementForLink foo = cls.methods[0];
    expect(foo.parameters, hasLength(1));
    FunctionType barType = foo.parameters[0].type;
    expect(barType.parameters[0].type.toString(), 'int');
  }

@scheglov
Copy link
Contributor

scheglov commented Jun 5, 2017

scheglov added a commit that referenced this issue Jun 5, 2017
@scheglov scheglov self-assigned this Jun 5, 2017
@scheglov
Copy link
Contributor

scheglov commented Jun 5, 2017

c61167a

@scheglov scheglov closed this as completed Jun 5, 2017
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. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants