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.22k stars 1.57k forks source link

Element not found in summary during resynthesis #35620

Closed nousath closed 4 years ago

nousath commented 5 years ago

Analyzer Feedback from IntelliJ

Version information

Exception

Please append the contents of: file://C:\Users\NOUSAT~1\AppData\Local\Temp\report.txt


Dart analysis server, SDK version 2.2.0-edge.d1817ddc91fd3aea061647b2e21860c47a5a5180, server version 1.21.1, error: Analysis failed: D:\flutter_app\main\hih\doctor\lib\data\models\entities.dart context: exception_20190110_120341_353
Exception: Element not found in summary: package:built_collection/src/list.dart
bkonyi commented 5 years ago

It's not exactly clear what's the issue here. Would you mind clarifying @nousath?

kevmoo commented 5 years ago

@nousath – please include the full contents of :\Users\NOUSAT~1\AppData\Local\Temp\report.txt

kika commented 5 years ago

@kevmoo Here's mine, I have these multiple times a day.

Dart analysis server, SDK version 2.2.0-edge.2cb346bd0cce075a5b7988cedb678e822a1d50f4, server version 1.21.1, error: Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart context: exception_20190123_203504_633
Exception: Element not found in summary: dart:core;dart:core/list.dart;Widge
#0      SummaryResynthesizer.getElement (package:analyzer/src/summary/resynthesize.dart:314:9)
#1      ElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:353:42)
#2      ClassElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:34:43)
#3      ClassElementHandle.type (package:analyzer/src/dart/element/handle.dart:113:29)
#4      _ReferenceInfo._buildType.<anonymous closure> (package:analyzer/src/summary/resynthesize.dart:1019:48)
#5      InterfaceTypeImpl.typeArguments (package:analyzer/src/dart/element/type.dart:1439:26)
#6      DeclarationResolver._setGenericFunctionType (package:analyzer/src/generated/declaration_resolver.dart:522:37)
#7      DeclarationResolver.visitMethodDeclaration (package:analyzer/src/generated/declaration_resolver.dart:363:5)
#8      MethodDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7730:49)
#9      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8372:20)
#10     ClassDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1795:13)
#11     RecursiveAstVisitor.visitClassDeclaration (package:analyzer/dart/ast/visitor.dart:691:10)
#12     DeclarationResolver.visitClassDeclaration.<anonymous closure> (package:analyzer/src/generated/declaration_resolver.dart:87:13)
#13     DeclarationResolver._walk (package:analyzer/src/generated/declaration_resolver.dart:542:13)
#14     DeclarationResolver.visitClassDeclaration (package:analyzer/src/generated/declaration_resolver.dart:86:5)
#15     ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1765:49)
#16     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8372:20)
#17     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2443:21)
#18     RecursiveAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:715:10)
#19     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2436:49)
#20     DeclarationResolver.resolve (package:analyzer/src/generated/declaration_resolver.dart:49:12)
#21     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:597:31)
#22     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:118:7)
#23     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
#24     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:117:11)
#25     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:91:14)
#26     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#27     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:90:43)
#28     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1431:63)
#29     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#30     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1409:20)
#31     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1203:17)
<asynchronous suspension>
#32     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2116:24)
<asynchronous suspension>
#33     AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2057:5)
#34     new AnalysisServer (package:analysis_server/src/analysis_server.dart:236:29)
#35     SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:79:26)
#36     StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#37     Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:519:21)
#38     _rootRun (dart:async/zone.dart:1124:13)
#39     _CustomZone.run (dart:async/zone.dart:1021:19)
#40     _runZoned (dart:async/zone.dart:1516:10)
#41     runZoned (dart:async/zone.dart:1463:12)
#42     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:585:12)
#43     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:517:7)
#44     Driver.start (package:analysis_server/src/server/driver.dart:414:7)
#45     main (file:///b/rr/tmpeKZXk6/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:12:11)
#46     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#47     main (file:///b/rr/tmpeKZXk6/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:10:10)
#48     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#49     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
1548304487036 <= {"event":"analysis.highlights","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","regions":[{"type":"DIRECTIVE","offset":0,"length":22},{"type"
1548304487037 <= {"event":"analysis.navigation","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","regions":[{"offset":8,"length":13,"targets":[0]},{"offset":30
1548304487037 <= {"event":"analysis.closingLabels","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","labels":[{"offset":1698,"length":5746,"label":"StoreConnec
1548304487038 <= {"event":"analysis.outline","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","kind":"PART","libraryName":"project_widgets","outline":{"element":
1548304487038 <= {"event":"analysis.overrides","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","overrides":[{"offset":109,"length":11,"superclassMember":{"ele
1548304487215 <= {"event":"analysis.errors","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","errors":[{"severity":"INFO","type":"TODO","location":{"file":"/Us
1548304487217 <= {"id":"209","result":{"assists":[{"message":"Convert to async function body","edits":[{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","fileStamp":0,"e
1548304487219 <= {"event":"analysis.highlights","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","regions":[{"type":"DIRECTIVE","offset":0,"length":22},{"type"
1548304487221 <= {"event":"analysis.navigation","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","regions":[{"offset":8,"length":13,"targets":[0]},{"offset":30
1548304487221 <= {"event":"analysis.closingLabels","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","labels":[{"offset":1698,"length":5747,"label":"StoreConnec
1548304487222 <= {"event":"analysis.outline","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","kind":"PART","libraryName":"project_widgets","outline":{"element":
1548304487222 <= {"event":"analysis.overrides","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","overrides":[{"offset":109,"length":11,"superclassMember":{"ele
1548304487227 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548304487228 <= {"event":"analysis.implemented","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","classes":[],"members":[]}}
1548304488179 => {"id":"210","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":5038,"length":0},"clientRequestTime":15483044
1548304488181 <= {"id":"210","result":{"assists":[]}}
1548304491152 => {"id":"211","method":"edit.getFixes","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":5018},"clientRequestTime":1548304491152}
1548304491155 <= {"id":"211","result":{"fixes":[{"error":{"severity":"ERROR","type":"SYNTACTIC_ERROR","location":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offse
1548304491164 => {"id":"212","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":5023,"length":0},"clientRequestTime":15483044
1548304491166 <= {"id":"212","result":{"assists":[]}}
1548304496684 => {"id":"213","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widget
1548304496685 <= {"id":"213","result":{}}
1548304496685 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548304496786 <= {"event":"server.error","params":{"isFatal":false,"message":"Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart context: exception_20190123_203456
1548304496791 <= {"event":"analysis.errors","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/rate.dart","errors":[]}}
1548304496792 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548304504522 => {"id":"214","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widget
1548304504528 <= {"id":"214","result":{}}
1548304504529 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548304504635 <= {"event":"server.error","params":{"isFatal":false,"message":"Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart context: exception_20190123_203504
stereotype441 commented 5 years ago

@kika from your stack trace it looks like the analyzer is crashing because it's looking for a declaration called Widge in the file lib/core/list.dart in your SDK. Is it possible that you accidentally navigated to that file and pasted in some text? (Maybe you were starting to type Widget and then realized you were in the wrong file?) Would you mind looking at that file on your computer to see if the string Widge appears anywhere in it?

kika commented 5 years ago

@stereotype441 I never ever opened any file from the core in this editor (Android Studio). But I experience these crashes mostly when I type and the IntelliJ completion engine tries to help me with suggestions. So it's entirely possible that I was typing Widget and it failed somewhere in mid-flight. The probability of me typing something into the core file is like 0.1% :-)

stereotype441 commented 5 years ago

@kika Just to be absolutely certain, would you mind just double checking the contents of your lib/core/list.dart file and searching for Widge in it? It's possible that a stray keypress could have caused you to open the file without realizing it (e.g. hitting the keyboard shortcut for "go to definition" in your editor can cause an SDK file to be opened). I know it's unlikely, but it would explain the error you're seeing, so I'd like to rule it out.

kika commented 5 years ago

@stereotype441 Sure, I did that, and the file is intact, there's no Widge there :-) I believe this is something with the exception logging, because in other exceptions (and oh boy I see them alot!) I've also seen such truncated strings in the first line of exception.

kika commented 5 years ago

@stereotype441 Another one. First line is not truncated (or it's just luck), apparently, but also seems to be happening somewhere in dart:core which I don't touch, didn't touch and don't even know exactly where it lives on my machine if not from these exceptions:

Dart analysis server, SDK version 2.2.0-edge.2cb346bd0cce075a5b7988cedb678e822a1d50f4, server version 1.21.1, error: Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart
Exception: Element not found in summary: dart:core;dart:core/string.dart;Future
#0      SummaryResynthesizer.getElement (package:analyzer/src/summary/resynthesize.dart:314:9)
#1      ElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:353:42)
#2      ClassElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:34:43)
#3      ClassElementHandle.type (package:analyzer/src/dart/element/handle.dart:113:29)
#4      _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1006:24)
#5      _ReferenceInfo.type (package:analyzer/src/summary/resynthesize.dart:952:15)
#6      _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:977:15)
#7      _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#8      _UnitResynthesizer.buildType.getTypeArgument (package:analyzer/src/summary/resynthesize.dart:1360:18)
#9      _ReferenceInfo._buildTypeArguments (package:analyzer/src/summary/resynthesize.dart:1140:43)
#10     _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1008:25)
#11     _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:978:15)
#12     _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#13     _UnitResynthesizer.buildType.getTypeArgument (package:analyzer/src/summary/resynthesize.dart:1360:18)
#14     _ReferenceInfo._buildTypeArguments (package:analyzer/src/summary/resynthesize.dart:1140:43)
#15     _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1008:25)
#16     _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:978:15)
#17     _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#18     _UnitResynthesizer.buildLinkedType (package:analyzer/src/summary/resynthesize.dart:1325:12)
#19     SummaryResynthesizerContext.resolveLinkedType (package:analyzer/src/summary/resynthesize.dart:464:30)
#20     NonParameterVariableElementImpl.type (package:analyzer/src/dart/element/element.dart:6742:12)
#21     PropertyInducingElementImpl.type (package:analyzer/src/dart/element/element.dart:7629:18)
#22     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:593:11)
#23     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:118:7)
#24     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
#25     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:117:11)
#26     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:91:14)
#27     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#28     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:90:43)
#29     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1431:63)
#30     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#31     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1409:20)
#32     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1203:17)
<asynchronous suspension>
#33     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2116:24)
<asynchronous suspension>
#34     AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2057:5)
#35     new AnalysisServer (package:analysis_server/src/analysis_server.dart:236:29)
#36     SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:79:26)
#37     StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#38     Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:519:21)
#39     _rootRun (dart:async/zone.dart:1124:13)
#40     _CustomZone.run (dart:async/zone.dart:1021:19)
#41     _runZoned (dart:async/zone.dart:1516:10)
#42     runZoned (dart:async/zone.dart:1463:12)
#43     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:585:12)
#44     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:517:7)
#45     Driver.start (package:analysis_server/src/server/driver.dart:414:7)
#46     main (file:///b/rr/tmpeKZXk6/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:12:11)
#47     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#48     main (file:///b/rr/tmpeKZXk6/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:10:10)
#49     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#50     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
1548533506138 <= {"id":"2001","result":{}}
1548533506138 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533506139 => {"id":"2002","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1443,"length":0},"clientRequestTime":1548533
1548533506249 <= {"id":"2002","result":{"assists":[]}}
1548533506253 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548533506858 => {"id":"2003","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1502,"length":0},"clientRequestTime":1548533
1548533506859 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533506924 <= {"id":"2003","result":{"assists":[]}}
1548533506927 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548533507248 => {"id":"2004","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1504,"length":0},"clientRequestTime":1548533
1548533507248 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533507316 <= {"id":"2004","result":{"assists":[]}}
1548533507318 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548533508513 => {"id":"2005","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widge
1548533508514 <= {"id":"2005","result":{}}
1548533508514 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533508515 => {"id":"2006","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1503,"length":0},"clientRequestTime":1548533
1548533508595 <= {"id":"2006","result":{"assists":[]}}
1548533508600 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548533509697 => {"id":"2007","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widge
1548533509698 <= {"id":"2007","result":{}}
1548533509698 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533509698 => {"id":"2008","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1505,"length":0},"clientRequestTime":1548533
1548533509781 <= {"id":"2008","result":{"assists":[]}}
1548533509784 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548533511186 => {"id":"2009","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widge
1548533511187 <= {"id":"2009","result":{}}
1548533511187 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548533511198 => {"id":"2010","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1506,"length":0},"clientRequestTime":1548533
1548533511280 <= {"event":"server.error","params":{"isFatal":false,"message":"Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","stackTrace":"Exception: Element 
kika commented 5 years ago

I wonder what core/string has to do with Future

stereotype441 commented 5 years ago

Thanks for the follow-up @kika. I'm still not sure what's going on, but we definitely have the information we need from you to investigate further.

stereotype441 commented 5 years ago

Raising priority due to duplicate bug reports.

stereotype441 commented 5 years ago

@scheglov FYI, this looks a lot like the stack traces from #34544 and #34555, but it's from a version after those two bugs were fixed.

kika commented 5 years ago

This one is interesting. I've "downgraded" to Flutter beta which recently became 1.1.8 to see if it's more stable. I was working fine for a while until I decided to move some code from existing file to a new one. I've created a new file, cut the code and pasted it into the new file. The code was correct and compiled fine before, but obviously, after this copy-paste, it generated a bunch of errors in both the source and the newly created destination files. As soon as I finished pasting and saw errors popping up in DA window, it blew up again.

Also, the first error from DA that popped up didn't make any sense: error: Undefined name 'immutable' used as an annotation.

it was a part of (correct) pasted code and it was used as usual:

@immutable
class _SearchQuery {
...
}

The rest of errors did make sense, these were missing type definitions which were not moved along with the copy-pasted code.

FWIW.

Analyzer Feedback from IntelliJ

Version information

Exception

Dart analysis server, SDK version 2.2.0-edge.ec86471ccc47a62df8b4009e1fb37c66ff9dc91b, server version 1.21.1, error: Analysis failed: /Users/kika/Projects/Cuida/FlutterApp/cuida/lib/ui/widgets/search.dart context: exception_20190131_172709_188
Exception: Element not found in summary: dart:core
Dart analysis server, SDK version 2.2.0-edge.ec86471ccc47a62df8b4009e1fb37c66ff9dc91b, server version 1.21.1, error: Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart context: exception_20190131_172709_188
Exception: Element not found in summary: dart:core;dart:core/string.dart;bool
#0      SummaryResynthesizer.getElement (package:analyzer/src/summary/resynthesize.dart:314:9)
#1      ElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:353:42)
#2      ClassElementHandle.actualElement (package:analyzer/src/dart/element/handle.dart:34:43)
#3      ClassElementHandle.type (package:analyzer/src/dart/element/handle.dart:113:29)
#4      _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1006:24)
#5      _ReferenceInfo.type (package:analyzer/src/summary/resynthesize.dart:952:15)
#6      _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:977:15)
#7      _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#8      _UnitResynthesizer.buildType.getTypeArgument (package:analyzer/src/summary/resynthesize.dart:1360:18)
#9      _ReferenceInfo._buildTypeArguments (package:analyzer/src/summary/resynthesize.dart:1140:43)
#10     _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1008:25)
#11     _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:978:15)
#12     _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#13     _UnitResynthesizer.buildType.getTypeArgument (package:analyzer/src/summary/resynthesize.dart:1360:18)
#14     _ReferenceInfo._buildTypeArguments (package:analyzer/src/summary/resynthesize.dart:1140:43)
#15     _ReferenceInfo._buildType (package:analyzer/src/summary/resynthesize.dart:1008:25)
#16     _ReferenceInfo.buildType (package:analyzer/src/summary/resynthesize.dart:978:15)
#17     _UnitResynthesizer.buildType (package:analyzer/src/summary/resynthesize.dart:1372:28)
#18     _UnitResynthesizer.buildLinkedType (package:analyzer/src/summary/resynthesize.dart:1325:12)
#19     SummaryResynthesizerContext.resolveLinkedType (package:analyzer/src/summary/resynthesize.dart:464:30)
#20     NonParameterVariableElementImpl.type (package:analyzer/src/dart/element/element.dart:6742:12)
#21     PropertyInducingElementImpl.type (package:analyzer/src/dart/element/element.dart:7629:18)
#22     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:593:11)
#23     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:118:7)
#24     __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.forEach (dart:collection/runtime/libcompact_hash.dart:367:8)
#25     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:117:11)
#26     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:91:14)
#27     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#28     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:90:43)
#29     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1431:63)
#30     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:34:15)
#31     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1409:20)
#32     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1223:33)
<asynchronous suspension>
#33     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2116:24)
<asynchronous suspension>
#34     AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:2057:5)
#35     new AnalysisServer (package:analysis_server/src/analysis_server.dart:236:29)
#36     SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:79:26)
#37     StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37:18)
#38     Driver.startAnalysisServer.<anonymous closure> (package:analysis_server/src/server/driver.dart:519:21)
#39     _rootRun (dart:async/zone.dart:1124:13)
#40     _CustomZone.run (dart:async/zone.dart:1021:19)
#41     _runZoned (dart:async/zone.dart:1516:10)
#42     runZoned (dart:async/zone.dart:1463:12)
#43     Driver._captureExceptions (package:analysis_server/src/server/driver.dart:585:12)
#44     Driver.startAnalysisServer (package:analysis_server/src/server/driver.dart:517:7)
#45     Driver.start (package:analysis_server/src/server/driver.dart:414:7)
#46     main (file:///b/rr/tmpFYAHZv/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:12:11)
#47     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#48     main (file:///b/rr/tmpFYAHZv/w/src/third_party/dart/pkg/analysis_server/bin/server.dart:10:10)
#49     _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#50     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
1548984398134 <= {"id":"374","result":{"assists":[]}}
1548984398548 => {"id":"375","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1255,"length":1198},"clientRequestTime":15489
1548984398550 <= {"id":"375","result":{"assists":[]}}
1548984399301 => {"id":"376","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1255,"length":1199},"clientRequestTime":15489
1548984399302 <= {"id":"376","result":{"assists":[]}}
1548984400414 => {"id":"377","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1255,"length":1198},"clientRequestTime":15489
1548984400415 <= {"id":"377","result":{"assists":[]}}
1548984402053 => {"id":"378","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"add","content":"part of project_widget
1548984402054 <= {"id":"378","result":{}}
1548984402055 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548984402056 => {"id":"379","method":"edit.getAssists","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart","offset":1255,"length":0},"clientRequestTime":15489844
1548984402166 <= {"id":"379","result":{"assists":[]}}
1548984402177 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548984428920 => {"id":"380","method":"analysis.setPriorityFiles","params":{"files":["/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart"]},"clientRequestTime":1548984428920}
1548984428920 => {"id":"381","method":"analysis.setSubscriptions","params":{"subscriptions":{"OVERRIDES":["/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart"],"CLOSING_LABELS":["/Users
1548984428924 <= {"id":"380"}
1548984428931 <= {"id":"381"}
1548984428931 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548984428940 <= {"event":"analysis.errors","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","errors":[]}}
1548984428941 <= {"event":"analysis.highlights","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","regions":[]}}
1548984428941 <= {"event":"analysis.navigation","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","regions":[],"targets":[],"files":[]}}
1548984428942 <= {"event":"analysis.closingLabels","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","labels":[]}}
1548984428942 <= {"event":"analysis.outline","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name
1548984428942 <= {"event":"analysis.overrides","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","overrides":[]}}
1548984428945 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1548984428946 <= {"event":"analysis.implemented","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","classes":[],"members":[]}}
1548984429104 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1548984429109 <= {"event":"analysis.errors","params":{"file":"/Users/kika/Projects/Project/FlutterApp/project/lib/state/search.dart","errors":[]}}
1548984429193 => {"id":"382","method":"analysis.updateContent","params":{"files":{"/Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart":{"type":"remove"}}},"clientRequestTime":15489
1548984429194 <= {"event":"server.error","params":{"isFatal":false,"message":"Analysis failed: /Users/kika/Projects/Project/FlutterApp/project/lib/ui/widgets/search.dart context: exception_20190131_172709
jackokring commented 5 years ago

My version of this started with PictureRecorder and dart:io. I think the name clashes are very problematic. Canvas (ui) vs. Canvas (material CustomPainter). They reduced a lot when imported dart:hi as Good (under the ...) and fixed Paint where needed to Hood.Paint etc. Redefinition from libraries do not seem to flag.

jackokring commented 5 years ago

dart:ui as Hood. Damn spell auto. When I open on Thursday it will likely work till the first edit of the file using Hood.x ... I shutdown today with a issue where the analyser was saying my GlobalKey global = GlobalKey(); thought the global key was a function definition, and was saying needs arguments. Lucky I won't have to edit the file again when it's done.

stereotype441 commented 5 years ago

This issue has also been seen internally as of fe73eaab0abb9e2c5316c597bd4e2b171633a39b (b/123988742). @scheglov could you have a look?

jackokring commented 5 years ago

It still does it after today's dart update on 12th Feb 2019. A common cause is an edit to a generic Future. So say void fn() and this needs to be an async to catch a future. Future<>void fn() (auto brackets, 100% the analyser fails exactly then), Future<void fn() and then Future<void> fn() ... often the analyser comes back, but not always.

scheglov commented 5 years ago

I tried to type Future<>void fn() {} in an empty file, and cannot reproduce the crash.

stereotype441 commented 5 years ago

@scheglov FYI, #36031 has some additional info that may help us reproduce this.

srawlins commented 4 years ago

Closing this as stale. Sorry we didn't get a chance to look at this issue. It was reported against a version of Dart that is at least 6 months old; please re-open if you encounter this on the latest version of Dart (or Flutter).