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

NNBD readiness tracking #58026

Closed
1 of 3 tasks
pq opened this issue Oct 9, 2019 · 1 comment
Closed
1 of 3 tasks

NNBD readiness tracking #58026

pq opened this issue Oct 9, 2019 · 1 comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@pq
Copy link
Member

pq commented Oct 9, 2019

linting non-migrated code

Running linter tests w/ NNBD exposes some issues.

See: dart-lang/linter#1758 for failures in:

  • prefer_bool_in_asserts
  • void_checks

and an

  • Object.noSuchMethod in ResolverVisitor.visitForStatementInScope (fixed in 795949d)

linting migrated code

See: #58032.

resources

@pq
Copy link
Member Author

pq commented Oct 9, 2019

/cc @MichaelRFairhurst @bwilkerson

dart-bot referenced this issue Oct 9, 2019
See: https://github.com/dart-lang/linter/issues/1759

Addresses Object.noSuchMethod:

00:53 +313 -3: rule dart (config: nnbd) omit_local_variable_types [E]
  NoSuchMethodError: The getter 'declaredElement' was called on null.
  Receiver: null
  Tried calling: declaredElement
  #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
  #1      ResolverVisitor.visitForStatementInScope (package:analyzer/src/generated/resolver.dart:3993:30)
  #2      ScopedVisitor.visitForStatement (package:analyzer/src/generated/resolver.dart:5477:7)
  #3      ForStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:4772:49)
  #4      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7682:20)
  #5      BlockImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1115:17)
  #6      ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #7      UnifyingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:3128:31)
  #8      ScopedVisitor.visitBlock (package:analyzer/src/generated/resolver.dart:5187:13)
  #9      BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1111:49)
  #10     BlockFunctionBodyImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1070:13)
  #11     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #12     UnifyingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:3131:55)
  #13     ScopedVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:5198:13)
  #14     ResolverVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:3522:13)
  #15     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1066:49)
  #16     FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5088:12)
  #17     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #18     UnifyingAstVisitor.visitFunctionExpression (package:analyzer/dart/ast/visitor.dart:3263:57)
  #19     ScopedVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:5524:13)
  #20     ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:4050:13)
  #21     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5082:49)
  #22     FunctionDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4941:26)
  #23     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:4286:10)
  #24     UnifyingAstVisitor.visitFunctionDeclaration (package:analyzer/dart/ast/visitor.dart:3256:59)
  #25     ScopedVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:5517:11)
  #26     ResolverVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:4025:11)
  #27     ScopedVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:5510:7)
  #28     ResolverVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:4016:13)
  #29     FunctionDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:4934:49)
  #30     ResolverVisitor.visitCompilationUnit (package:analyzer/src/generated/resolver.dart:3608:23)
  #31     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2140:49)
  #32     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:680:10)
  #33     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:151:7)
  #34     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
  #35     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:150:11)
  #36     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:113:14)
  #37     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
  #38     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:112:43)
  #39     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1261:63)
  #40     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
  #41     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1237:20)
  #42     AnalysisDriver.getErrors (package:analyzer/src/dart/analysis/driver.dart:548:41)
  <asynchronous suspension>
  #43     LintDriver.analyze (package:analyzer/src/lint/analysis.dart:220:32)
  <asynchronous suspension>
  #44     DartLinter.lintFiles (package:analyzer/src/lint/linter.dart:87:36)
  <asynchronous suspension>
  #45     testRule.<anonymous closure> (file:///Users/pquitslund/src/repos/linter/test/rule_test.dart:262:54)
  <asynchronous suspension>
  #46     Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:168:27)
  <asynchronous suspension>
  #47     Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:242:15)
  <asynchronous suspension>
  #48     _rootRun (dart:async/zone.dart:1124:13)
  #49     _CustomZone.run (dart:async/zone.dart:1021:19)
  #50     _runZoned (dart:async/zone.dart:1516:10)
  #51     runZoned (dart:async/zone.dart:1463:12)
  #52     Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:239:5)
  #53     Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:166:33)
  #54     _rootRun (dart:async/zone.dart:1124:13)
  #55     _CustomZone.run (dart:async/zone.dart:1021:19)
  #56     _runZoned (dart:async/zone.dart:1516:10)
  #57     runZoned (dart:async/zone.dart:1463:12)
  #58     Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:165:13)
  <asynchronous suspension>
  #59     Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:392:25)
  <asynchronous suspension>
  #60     new Future.<anonymous closure> (dart:async/future.dart:176:37)
  #61     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
  #62     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
  #63     _rootRun (dart:async/zone.dart:1120:38)
  #64     _CustomZone.run (dart:async/zone.dart:1021:19)
  #65     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
  #66     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
  #67     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
  #68     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
  #69     _rootRun (dart:async/zone.dart:1124:13)
  #70     _CustomZone.run (dart:async/zone.dart:1021:19)
  #71     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
  #72     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:21:15)
  #73     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:382:19)
  #74     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
  #75     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)




Change-Id: I15b2298f88ee986475736807ef8fd15133e18472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120928
Reviewed-by: Paul Berry <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
@pq pq closed this as completed Mar 26, 2021
@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

2 participants