dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.25k stars 1.58k forks source link

Stack Overflow analyzer failure after NNBD change #39937

Closed olesiathoms-wk closed 4 years ago

olesiathoms-wk commented 4 years ago

After updating to dart 2.7.0 in built_redux analysis fails with following exception:

Stack Overflow
#0      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:602:3)
#1      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#2      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#3      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#4      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:747:13)
#5      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#6      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#7      Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1105:14)
#8      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:814:14)
#9      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#10     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#11     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#12     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:747:13)
#13     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#14     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#15     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1105:14)
#16     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:814:14)
#17     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#18     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#19     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#20     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:747:13)
#21     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#22     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#23     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1105:14)
#24     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:814:14)
#25     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#26     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#27     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#28     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:747:13)
#29     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#30     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#31     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1105:14)
#32     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:814:14)
#33     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#34     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#35     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#36     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:747:13)
#37     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#38     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#39     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1105:14)
#40     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:814:14)
#41     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:793:11)
#42     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#43     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
...
...
#6602   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:715:14)
#6603   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:708:14)
#6604   _OverrideChecker._findCovariantChecksForMember.<anonymous closure> (package:analyzer/src/task/strong/checker.dart:1614:20)
#6605   FunctionTypeImpl.relateTypeFormals2 (package:analyzer/src/dart/element/type.dart:875:20)
#6606   _OverrideChecker._findCovariantChecksForMember (package:analyzer/src/task/strong/checker.dart:1610:34)
#6607   _OverrideChecker._findCovariantChecks (package:analyzer/src/task/strong/checker.dart:1542:9)
#6608   _OverrideChecker._checkForCovariantGenerics (package:analyzer/src/task/strong/checker.dart:1488:18)
#6609   _OverrideChecker.check (package:analyzer/src/task/strong/checker.dart:1424:5)
#6610   CodeChecker.visitClassDeclaration (package:analyzer/src/task/strong/checker.dart:330:22)
#6611   ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1512:49)
#6612   NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7516:20)
#6613   CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2111:21)
#6614   CodeChecker.visitCompilationUnit (package:analyzer/src/task/strong/checker.dart:351:10)
#6615   LibraryAnalyzer._computeVerifyErrors (package:analyzer/src/dart/analysis/library_analyzer.dart:368:13)
#6616   LibraryAnalyzer.analyzeSync.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:165:9)
#6617   _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#6618   LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:164:13)
#6619   _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#6620   LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:163:34)
#6621   LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:114:14)
#6622   _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#6623   LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:113:43)
#6624   AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1261:63)
#6625   PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#6626   AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1237:20)
#6627   AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1047:17)
#6628   _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#6629   _rootRunUnary (dart:async/zone.dart:1132:38)
#6630   _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6631   _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#6632   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#6633   Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#6634   Future._addListener.<anonymous closure> (dart:async/future_impl.dart:387:9)
#6635   _rootRun (dart:async/zone.dart:1124:13)
#6636   _CustomZone.runGuarded (dart:async/zone.dart:1021:19)
#6637   _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#6638   _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#6639   _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#6640   _Timer._runTimers (dart:isolate-patch/timer_impl.dart:391:30)
#6641   _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart)

Dart 2.6.1 doesn't have this problem. Going through changes made between 2.6.1. and 2.7.0. I found out that switch to NNBD subtyping rules caused analyzer to fail https://github.com/dart-lang/sdk/commit/70b1cedd87191d11293b5d1192fada7fdbc8fc04

I think combinedNested functions causing this problem from built_redux side: https://github.com/davidmarne/built_redux/blob/master/lib/src/middleware.dart#L52-L61 https://github.com/davidmarne/built_redux/blob/master/lib/src/reducer_builder.dart#L31-L36 specifically extensions on Built and Builder. Was this expected? if so, do we need to update our code to follow new rules?

~/built_redux (master ✔) ᐅ dartanalyzer  --version
dartanalyzer version 2.7.0
~/built_redux (master ✔) ᐅ dart --version
Dart VM version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "macos_x64"
bwilkerson commented 4 years ago

@scheglov

scheglov commented 4 years ago

No, this is not expected, any code should be handled without crashes in analyzer.

Unfortunately I cannot reproduce the issue. I cloned the repo https://github.com/davidmarne/built_redux.

Then I run flutter analyzer while in /Users/scheglov/dart/built_redux:

Upgrading Flutter from /Users/scheglov/Source/flutter...
Updating cf37c2cd0..27321ebba
 24 files changed, 651 insertions(+), 218 deletions(-)
Flutter is already up to date on channel stable
Flutter 1.12.13+hotfix.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 27321ebbad (2 weeks ago) • 2019-12-10 18:15:01 -0800
Engine • revision 2994f7e1e6
Tools • Dart 2.7.0
scheglov@scheglov-macbookpro2:~/dart/built_redux (master)$ flutter analyze
Downloading package sky_engine...                                   0.4s
Downloading common tools...                                         1.2s
Downloading common tools...                                         1.3s
Downloading darwin-x64 tools...                                     3.5s
Running "flutter pub get" in built_redux...                         0.6s
Analyzing built_redux...
No issues found! (ran in 10.2s)

I also tried the bleeding edge of Dart SDK, it still can be analyzer without the Stack Overflow.

It also does not crash with the master channel of Flutter, which is Dart 2.8.0 AFAIK.

Does the way I tried to reproduce looks right to you? Do I need a different version of built_redux?

olesiathoms-wk commented 4 years ago

you should be able to reproduce it on master. Is there a difference between flutter analyze and dartanalyzer? I just tried using flutter and it worked, but at the same time dartanalyzer fails.

~/built_redux (master ✔) ᐅ flutter analyze
Analyzing built_redux...
No issues found! (ran in 9.4s)
~/built_redux (master ✔) ᐅ dartanalyzer .
Analyzing built_redux...
Unhandled exception:
Stack Overflow
#0      new TypeParameterTypeImpl (package:analyzer/src/dart/element/type.dart:2158:3)
#1      TypeParameterTypeImpl.withNullability (package:analyzer/src/dart/element/type.dart:2265:12)
#2      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1216:19)
#3      Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#4      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#5      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#6      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#7      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#8      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#9      Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#10     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#11     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#12     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#13     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#14     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#15     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#16     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#17     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#18     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#19     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#20     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#21     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#22     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#23     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#24     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#25     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#26     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#27     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#28     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#29     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#30     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#31     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#32     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#33     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#34     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#35     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#36     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#37     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#38     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#39     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#40     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#41     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#42     Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#43     Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
...
...
#6200   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1256:13)
#6201   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#6202   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#6203   Dart2TypeSystem._isInterfaceSubtypeOf (package:analyzer/src/generated/type_system.dart:1762:16)
#6204   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1323:14)
#6205   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1302:11)
#6206   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1224:14)
#6207   Dart2TypeSystem.isSubtypeOf (package:analyzer/src/generated/type_system.dart:1217:14)
#6208   _OverrideChecker._findCovariantChecksForMember.<anonymous closure> (package:analyzer/src/task/strong/checker.dart:1610:20)
#6209   FunctionTypeImpl.relateTypeFormals2 (package:analyzer/src/dart/element/type.dart:791:20)
#6210   _OverrideChecker._findCovariantChecksForMember (package:analyzer/src/task/strong/checker.dart:1606:34)
#6211   _OverrideChecker._findCovariantChecks (package:analyzer/src/task/strong/checker.dart:1538:9)
#6212   _OverrideChecker._checkForCovariantGenerics (package:analyzer/src/task/strong/checker.dart:1484:18)
#6213   _OverrideChecker.check (package:analyzer/src/task/strong/checker.dart:1420:5)
#6214   CodeChecker.visitClassDeclaration (package:analyzer/src/task/strong/checker.dart:330:22)
#6215   ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1522:49)
#6216   NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7511:20)
#6217   CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2098:21)
#6218   CodeChecker.visitCompilationUnit (package:analyzer/src/task/strong/checker.dart:351:10)
#6219   LibraryAnalyzer._computeVerifyErrors (package:analyzer/src/dart/analysis/library_analyzer.dart:380:13)
#6220   LibraryAnalyzer.analyzeSync.<anonymous closure>.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:166:9)
#6221   _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
#6222   LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:165:13)
#6223   _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#6224   LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:164:34)
#6225   LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:115:14)
#6226   _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#6227   LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:114:43)
#6228   AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1275:63)
#6229   PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#6230   AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1251:20)
#6231   AnalysisDriver.getErrors (package:analyzer/src/dart/analysis/driver.dart:548:41)
#6232   _RootZone.runUnary (dart:async/zone.dart:1381:54)
#6233   _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6234   Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#6235   Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#6236   Future._addListener.<anonymous closure> (dart:async/future_impl.dart:389:9)
#6237   _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#6238   _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#6239   _Timer._runTimers (dart:isolate-patch/timer_impl.dart:393:30)
#6240   _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
#6241   _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

#0      AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1311:9)
#1      PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#2      AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1251:20)
#3      AnalysisDriver.getErrors (package:analyzer/src/dart/analysis/driver.dart:548:41)
<asynchronous suspension>
#4      AnalyzerImpl.prepareErrors (package:analyzer_cli/src/analyzer_impl.dart:129:58)
<asynchronous suspension>
#5      AnalyzerImpl._analyze (package:analyzer_cli/src/analyzer_impl.dart:168:11)
<asynchronous suspension>
#6      AnalyzerImpl.analyze (package:analyzer_cli/src/analyzer_impl.dart:105:18)
<asynchronous suspension>
#7      Driver._runAnalyzer (package:analyzer_cli/src/driver.dart:705:21)
#8      Driver._analyzeAllImpl (package:analyzer_cli/src/driver.dart:364:40)
<asynchronous suspension>
#9      Driver._analyzeAll (package:analyzer_cli/src/driver.dart:195:20)
<asynchronous suspension>
#10     Driver.start (package:analyzer_cli/src/driver.dart:156:38)
#11     main (file:///b/s/w/ir/cache/builder/sdk/pkg/analyzer_cli/bin/analyzer.dart:18:17)
#12     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:303:32)
#13     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
scheglov commented 4 years ago

flutter analyze runs Dart Analysis Server, and dartanalyzer is a separate CLI utility. In principle there should be no difference, both use analyzer for actual analysis, just different ways to build analysis contexts. But they might be have different versions - dartanalyzer is probably from normal, non-Flutter Dart SDK. Please check the Dart SDK version. FWIW, this works for me:

scheglov@scheglov-macbookpro2:~/dart/built_redux (master)$ dartanalyzer --version
dartanalyzer version 2.8.0-edge.3ab95a114c6ce260f1e54752b4ebc8c322173a8a
scheglov@scheglov-macbookpro2:~/dart/built_redux (master)$ dartanalyzer .
Analyzing built_redux...
No issues found!
olesiathoms-wk commented 4 years ago

I was on 2.7.0 and checked 2.8.0-dev.0.0 as well, they both were failing. I just checked the same version that you are on and it's working. I'll do a little more exploring, but I think it was fixed in some commit over last two weeks

olesiathoms-wk commented 4 years ago

I went through commits made after 2.8.0-dev.0.0 and

Dart VM version: 2.8.0-edge.b3c2eb9f698408bca8fa35ca5cc6c6f088098ec1 (Thu Dec 12 23:54:41 2019 +0000) on "macos_x64"

introduced fix for the first time. Is it possible to release it as a patch for 2.7?

jcollins-g commented 4 years ago

Verified that b3c2eb9f698408bca8fa35ca5cc6c6f088098ec1 does contain the fix, but it does not patch cleanly to 2.7.0. The conflict looks fairly trivial and a naive conflict resolution results in an analyzer that can at least analyze built_redux cleanly.

aaronlademann-wf commented 4 years ago

@bwilkerson @scheglov @jcollins-g any chance this gets patched into 2.7.x since _"the conflict looks fairly trivial and a naive conflict resolution results in an analyzer that can at least analyze builtredux cleanly."?

Or is the 2.8.0 release imminent?

This causes built_redux, and all packages that depend on it - to not produce API documentation when dartdoc is run using SDK version 2.7.x w/ analyzer version 0.39.4.

cc/ @greglittlefield-wf @md-weber @kevmoo @robbecker-wf

kevmoo commented 4 years ago

Is this an SDK issue or a pkg:analyzer issue?

jcollins-g commented 4 years ago

@kevmoo Yes to both. The report concerns the version of analyzer shipped as part of the 2.7 SDK.

kevmoo commented 4 years ago

CC @franklinyow @athomas

We could consider a 2.7.2 release for this.

@aaronlademann-wf – have ya'll looked at rolling to 2.8.0-dev.1.0 as an alternative?

aaronlademann-wf commented 4 years ago

@kevmoo I can do that locally - but that won't fix the underlying issue - which is that when a package that depends on built_redux is published to pub.dev, the generation of the API documentation will fail.

kevmoo commented 4 years ago

@kevmoo I can do that locally - but that won't fix the underlying issue - which is that when a package that depends on built_redux is published to pub.dev, the generation of the API documentation will fail.

Good to know. I'll work with @franklinyow on this.

kevmoo commented 4 years ago

Fixed in https://github.com/dart-lang/sdk/commit/b3c2eb9f698408bca8fa35ca5cc6c6f088098ec1

Will be available in the first Dart 2.8 stable release (and many recent 2.8.0-dev releases)