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

Null pointer in type check #27462

Closed
bwilkerson opened this issue Sep 30, 2016 · 3 comments
Closed

Null pointer in type check #27462

bwilkerson opened this issue Sep 30, 2016 · 3 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@bwilkerson
Copy link
Member

bwilkerson commented Sep 30, 2016

The line numbers have changed, but I believe the code is unchanged.

Count: 1
Session Id: 1474545975743.919

Message: Task failed: StrongModeVerifyUnitTask for source xxx.dart,
StackTrace: Unexpected exception while performing StrongModeVerifyUnitTask for source xxx.dart
#0      AnalysisTask._safelyPerform (package:analyzer/task/model.dart:350)
#1      AnalysisTask.perform (package:analyzer/task/model.dart:238)
#2      AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.dart:284)
#3      AnalysisDriver.performAnalysisTask (package:analyzer/src/task/driver.dart:255)
#4      AnalysisContextImpl.performAnalysisTask.<anonymous closure> (package:analyzer/src/context/context.dart:1231)
#5      _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#6      AnalysisContextImpl.performAnalysisTask (package:analyzer/src/context/context.dart:1229)
#7      PerformAnalysisOperation.perform (package:analysis_server/src/operation/operation_analysis.dart:374)
#8      AnalysisServer.performOperation (package:analysis_server/src/analysis_server.dart:889)
#9      Future.Future.<anonymous closure> (dart:async/future.dart:118)
#10     _rootRun (dart:async/zone.dart:1154)
#11     _CustomZone.run (dart:async/zone.dart:1034)
#12     _CustomZone.runGuarded (dart:async/zone.dart:932)
#13     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:959)
#14     _rootRun (dart:async/zone.dart:1158)
#15     _CustomZone.run (dart:async/zone.dart:1034)
#16     _CustomZone.runGuarded (dart:async/zone.dart:932)
#17     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:959)
#18     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:16)
#19     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:385)
#20     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414)
#21     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)

Caused by The null object does not have a getter 'isDynamic'.

NoSuchMethodError: method not found: 'isDynamic'
Receiver: null
Arguments: []
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:44)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
#2      _isTop (package:analyzer/src/generated/type_system.dart:1697)
#3      StrongTypeSystemImpl._isSubtypeOf (package:analyzer/src/generated/type_system.dart:753)
#4      StrongTypeSystemImpl.isSubtypeOf (package:analyzer/src/generated/type_system.dart:431)
#5      CodeChecker.visitFieldFormalParameter (package:analyzer/src/task/strong/checker.dart:384)
#6      FieldFormalParameterImpl.accept (package:analyzer/src/dart/ast/ast.dart:4420)
#7      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7688)
#8      FormalParameterListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4729)
#9      RecursiveAstVisitor.visitFormalParameterList (package:analyzer/dart/ast/visitor.dart:1587)
#10     FormalParameterListImpl.accept (package:analyzer/src/dart/ast/ast.dart:4725)
#11     MethodDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:7195)
#12     RecursiveAstVisitor.visitMethodDeclaration (package:analyzer/dart/ast/visitor.dart:1737)
#13     MethodDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7187)
#14     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7688)
#15     ClassDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1915)
#16     RecursiveAstVisitor.visitClassDeclaration (package:analyzer/dart/ast/visitor.dart:1425)
#17     CodeChecker.visitClassDeclaration (package:analyzer/src/task/strong/checker.dart:303)
#18     ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1847)
#19     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7688)
#20     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2446)
#21     CodeChecker.visitCompilationUnit (package:analyzer/src/task/strong/checker.dart:315)
#22     StrongModeVerifyUnitTask.internalPerform (package:analyzer/src/task/dart.dart:6335)
#23     AnalysisTask._safelyPerform (package:analyzer/task/model.dart:338)
#24     AnalysisTask.perform (package:analyzer/task/model.dart:238)
#25     AnalysisDriver.performWorkItem (package:analyzer/src/task/driver.dart:284)
#26     AnalysisDriver.performAnalysisTask (package:analyzer/src/task/driver.dart:255)
#27     AnalysisContextImpl.performAnalysisTask.<anonymous closure> (package:analyzer/src/context/context.dart:1231)
#28     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:212)
#29     AnalysisContextImpl.performAnalysisTask (package:analyzer/src/context/context.dart:1229)
#30     PerformAnalysisOperation.perform (package:analysis_server/src/operation/operation_analysis.dart:374)
#31     AnalysisServer.performOperation (package:analysis_server/src/analysis_server.dart:889)
#32     Future.Future.<anonymous closure> (dart:async/future.dart:118)
#33     _rootRun (dart:async/zone.dart:1154)
#34     _CustomZone.run (dart:async/zone.dart:1034)
#35     _CustomZone.runGuarded (dart:async/zone.dart:932)
#36     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:959)
#37     _rootRun (dart:async/zone.dart:1158)
#38     _CustomZone.run (dart:async/zone.dart:1034)
#39     _CustomZone.runGuarded (dart:async/zone.dart:932)
#40     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:959)
#41     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:16)
#42     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:385)
#43     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:414)
#44     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
@bwilkerson bwilkerson added 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. analyzer-strong-mode type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Sep 30, 2016
@jmesserly
Copy link

@bwilkerson -- any idea how we could have ended up with a FieldFormalParameter that has a null type?

it's supposed to be inferred from the field type. Worst case it will be dynamic not null, but the time it reaches CodeChecker (which is fairly late in the task model)

@bwilkerson
Copy link
Member Author

No. It's a little hard to tell which type is null without valid line numbers.

  • It's possible that the parameter has a type that is undefined (C(undefinedType this.field)).
  • It's possible that the parameter references a field with an unknown type.
  • It's possible that the parameter references a name that is not a field.
    In all those cases I would have expected that the type would have been converted into dynamic, but I haven't verified that.

It's also possible that there's another bug somewhere that's causing the information to be erased after it's been computed and then not re-computed.

@bwilkerson bwilkerson added P2 A bug or feature request we're likely to work on and removed P1 A high priority bug; for example, a single project is unusable or has many test failures labels Nov 29, 2016
@jmesserly
Copy link

not sure if we'll be able to take action on this now, so much has/is changing in the code base. if it shows up again we can investigate further.

@jmesserly jmesserly added closed-obsolete Closed as the reported issue is no longer relevant closed-cannot-reproduce Closed as we were unable to reproduce the reported issue and removed closed-obsolete Closed as the reported issue is no longer relevant labels Jun 27, 2018
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. closed-cannot-reproduce Closed as we were unable to reproduce the reported issue P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants