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

NPE in StaticTypeAnalyze when for-in is unresolved #33370

Closed
scheglov opened this Issue Jun 6, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@scheglov
Copy link
Contributor

commented Jun 6, 2018

I was typing something like, an maybe _addedRoots was incomplete and unresolved.

    for (var previousRoot in _addedRoots)

Analyzer Feedback from IntelliJ

Version information

  • IDEA 182.SNAPSHOT
  • 2.0.0-edge.9672d69a0691ef66a4b554537e26c8c0f95fcbe6
  • IC-182.SNAPSHOT, JRE 1.8.0_112-b16x64 Oracle Corporation, OS Mac OS X(x86_64) v10.13.4 unknown, screens 1680x1050 Retina

Exception

Please append the contents of:
file:///private/var/folders/cp/32g44l548q8d0bfj4_l9s3m003ky/T/report.txt

Dart analysis server, SDK version 2.0.0-edge.9672d69a0691ef66a4b554537e26c8c0f95fcbe6, server version 1.20.3, error: Analysis failed: /Users/scheglov/dart/pub/lib/src/dart.dart context: exception_20180606_115820_116
NoSuchMethodError: The method 'resolveToBound' was called on null.
Receiver: null
Tried calling: resolveToBound(Instance of 'InterfaceTypeImpl')
#0      Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1      StaticTypeAnalyzer._findIteratedType (package:analyzer/src/generated/static_type_analyzer.dart:1668:17)
#2      StaticTypeAnalyzer._inferForEachLoopVariableType (package:analyzer/src/generated/static_type_analyzer.dart:1924:33)
#3      StaticTypeAnalyzer.visitDeclaredIdentifier (package:analyzer/src/generated/static_type_analyzer.dart:496:7)
#4      DeclaredIdentifierImpl.accept (package:analyzer/src/dart/ast/ast.dart:3385:49)
#5      ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6341:10)
#6      UnifyingAstVisitor.visitDeclaredIdentifier (package:analyzer/dart/ast/visitor.dart:2971:57)
#7      ScopedVisitor.visitDeclaredIdentifier (package:analyzer/src/generated/resolver.dart:7527:34)
#8      DeclaredIdentifierImpl.accept (package:analyzer/src/dart/ast/ast.dart:3385:49)
#9      ResolverVisitor.visitForEachStatementInScope (package:analyzer/src/generated/resolver.dart:5996:19)
#10     ScopedVisitor.visitForEachStatement (package:analyzer/src/generated/resolver.dart:7584:7)

@bwilkerson bwilkerson added the type-bug label Aug 29, 2018

@bwilkerson bwilkerson added this to the Dart2.1 milestone Aug 29, 2018

@scheglov scheglov self-assigned this Sep 4, 2018

@scheglov

This comment has been minimized.

Copy link
Contributor Author

commented Sep 4, 2018

dart-bot pushed a commit that referenced this issue Sep 4, 2018

Fix for for-in when iterable does not have a type.
R=brianwilkerson@google.com

Bug: #33370
Change-Id: I22ee3c5861ecaa3e6b2bc0f00e7f04191bcd7e78
Reviewed-on: https://dart-review.googlesource.com/72960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

@scheglov scheglov closed this Sep 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.