Comments (4)
Interesting, I don't see a hard hang in unit tests for the element model and resolution.
But when I do it in IntelliJ, DAS sends server error.
## Dart analysis issue
Bad state: Unrecognized code part Instance of 'NamedTypeAnnotationImpl'
## Version information
- Dart SDK 3.5.0-edge.9315ae565160afea5ae049bde6aacd0cc077b07d
- Dart IntelliJ 241.15845
- IntelliJ IDEA 2024.1
- Mac OS X 14.4.1
## Details
Bad state: Unrecognized code part Instance of 'NamedTypeAnnotationImpl'
#0 SerializeCode.serialize (package:_macros/src/executor/serialization_extensions.dart:609:13)
#1 MacroExecutionResultImpl.serialize (package:_macros/src/executor/response_impls.dart:479:22)
#2 SerializeNullable.serializeNullable (package:_macros/src/executor/serialization_extensions.dart:495:12)
#3 SerializableResponse.serialize (package:_macros/src/executor/protocol.dart:136:18)
#4 MacroExpansionClient._handleMessage. (package:_macros/src/executor/client.dart:136:16)
#5 MacroExpansionClient._handleMessage (package:_macros/src/executor/client.dart:118:5)
## Debug log
1712867529318 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1712867529344 <= {"event":"analysis.errors","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","errors":[{"severity":"ERROR","type":"COMPILE_TIME_ERROR","location":{"file":"/Users/scheglov/da...
1712867529345 <= {"event":"analysis.highlights","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","regions":[{"type":"DIRECTIVE","offset":0,"length":11},{"type":"BUILT_IN","offset":0,"length...
1712867529345 <= {"event":"analysis.navigation","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","regions":[{"offset":30,"length":1,"targets":[0]},{"offset":41,"length":3,"targets":[1]}],"t...
1712867529345 <= {"event":"analysis.outline","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"","location":{"f...
1712867529345 <= {"event":"analysis.overrides","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","overrides":[]}}
1712867529378 <= {"id":"19590","result":{"replacementOffset":8,"replacementLength":1,"suggestions":[{"kind":"IMPORT","relevance":900,"completion":"append.dart","selectionOffset":11,"selectionLength":0...
1712867529382 <= {"event":"analysis.errors","params":{"file":"/Users/scheglov/dart/test/bin/test.dart","errors":[{"severity":"ERROR","type":"COMPILE_TIME_ERROR","location":{"file":"/Users/scheglov/dar...
1712867529413 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1712867529414 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1712867529414 <= {"event":"analysis.implemented","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","classes":[],"members":[]}}
1712867529443 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1712867530127 => {"id":"19591","method":"analysis.updateContent","params":{"files":{"/Users/scheglov/dart/test/bin/test3.dart":{"type":"add","content":"import 'appen';\n\n@CrashMe()\nclass A {\n void...
1712867530130 <= {"id":"19591","result":{}}
1712867530130 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1712867530169 <= {"event":"analysis.errors","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","errors":[{"severity":"ERROR","type":"COMPILE_TIME_ERROR","location":{"file":"/Users/scheglov/da...
1712867530169 <= {"event":"analysis.highlights","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","regions":[{"type":"DIRECTIVE","offset":0,"length":15},{"type":"BUILT_IN","offset":0,"length...
1712867530169 <= {"event":"analysis.navigation","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","regions":[{"offset":34,"length":1,"targets":[0]},{"offset":45,"length":3,"targets":[1]}],"t...
1712867530169 <= {"event":"analysis.outline","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","kind":"LIBRARY","outline":{"element":{"kind":"COMPILATION_UNIT","name":"","location":{"f...
1712867530169 <= {"event":"analysis.overrides","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","overrides":[]}}
1712867530173 <= {"event":"analysis.errors","params":{"file":"/Users/scheglov/dart/test/bin/test.dart","errors":[{"severity":"ERROR","type":"COMPILE_TIME_ERROR","location":{"file":"/Users/scheglov/dar...
1712867530206 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1712867530206 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1712867530206 <= {"event":"analysis.implemented","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","classes":[],"members":[]}}
1712867530231 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":false}}}
1712867530474 => {"id":"19592","method":"analysis.updateContent","params":{"files":{"/Users/scheglov/dart/test/bin/test3.dart":{"type":"add","content":"import 'append.dart';\n\n@CrashMe()\nclass A {\n...
1712867530479 => {"id":"19593","method":"edit.getFixes","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","offset":2},"clientRequestTime":1712867530479}
1712867530479 <= {"id":"19592","result":{}}
1712867530479 <= {"event":"server.status","params":{"analysis":{"isAnalyzing":true}}}
1712867530485 => {"id":"19594","method":"edit.getAssists","params":{"file":"/Users/scheglov/dart/test/bin/test3.dart","offset":19,"length":0},"clientRequestTime":1712867530485}
from sdk.
Ah, I run unit tests with asserts enabled, so the mistake does not allow you to create such invalid Code.fromParts()
at all. But if you don't have asserts enabled, e.g. when you run DAS from IntelliJ, you can. But then it hard crash later, at the point where it is not an assert. Which means that the first point also should be not just an assert, but full check. Or better typing.
from sdk.
The reason it hangs is that the analyzer does not get a response from the macro running isolate.
The macro isolate created the result, and crashed trying to send it, below in serialize()
.
case MessageType.executeDeclarationsPhaseRequest:
ExecuteDeclarationsPhaseRequest request =
ExecuteDeclarationsPhaseRequest.deserialize(deserializer, zoneId);
(await _executeDeclarationsPhase(request, sendRequest))
.serialize(serializer);
If we checked inside Code.fromParts()
, we would send the exception result instead.
from sdk.
https://dart-review.googlesource.com/c/sdk/+/362440
from sdk.
Related Issues (20)
- Type inference for abstract classes with recurring generics can't be inferred HOT 10
- The front end is not happy about wrong constructor declaration
- The front end is not happy about wrong extension type constructor declaration
- pkg/analyzer/test/src/dart/resolution/augmented_invocation_test fails with RuntimeError on analyzer-asserts-win bot HOT 2
- Code completion suggestions are irrelevant / context unaware HOT 2
- [Wildcard Variables] Language Tests in `tests/language` HOT 5
- [Wildcard Variables] All tests in `tests/language` and co19 passing.
- [Wildcard Variables] Experiment Flag HOT 3
- [Wildcard Variables] CFE Implementation
- [CP] Cherry-Pick "[cfe] Ensure default values in synthesized function nodes" HOT 6
- [vm] use_code_comments_flag_test timing out on vm-aot-linux-release-simarm_x64 HOT 1
- [analysis_server] Non-const constructors aren't suggested in a const context HOT 2
- Move analyzer test utilities to analyzer_utilities package HOT 3
- [Wildcard Variables] Feature Specification HOT 6
- Problems with moving comments when automatically moving child arg to last parameter position of widget constructor
- Unreachable code during SelectRepresentations HOT 1
- "Stop on uncaught exceptions" sometimes stops on caught exceptions HOT 4
- Improve thrown `FormatException` from `int.parse` when there is an "invalid radix-n" number HOT 1
- Very poor JIT performance with const Map<Type, ..> HOT 7
- DateTime.fromMillisecondsSinceEpoch constructor returns invalid time HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.