-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.crashProcess exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
I have this weird script, t.dart:
import "t.dart" as a;
enum MyEnum implements Bar<({a.B<int, (int c,)> e, Foo f})> {
a;
get field => throw "no";
}
class Bar<E> {
final E field;
Bar(this.field);
}
class B<E, F> {}
class Foo {}
Analyzing it is fine:
$ out/ReleaseX64/dart-sdk/bin/dart analyze t.dart
Analyzing t.dart...
No issues found!
If I then remove a comma:
import "t.dart" as a;
enum MyEnum implements Bar<({a.B<int, (int c)> e, Foo f})> {
a;
get field => throw "no";
}
class Bar<E> {
final E field;
Bar(this.field);
}
class B<E, F> {}
class Foo {}
it crashes:
$ out/ReleaseX64/dart-sdk/bin/dart analyze t.dart
Analyzing t.dart...
An unexpected error was encountered by the Analysis Server.
Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
Internal error: type '_ConstructorNameWithInvalidTypeArgs' is not a subtype of type 'ConstructorNameImpl?' in type cast
#0 LegacyAnalysisServer.sendServerErrorNotification (package:analysis_server/src/legacy_analysis_server.dart:742:31)
#1 ErrorNotifier.logException (package:analysis_server/src/server/error_notifier.dart:45:12)
#2 MulticastInstrumentationService.logException (package:analyzer/instrumentation/multicast_service.dart:28:15)
#3 Driver._captureExceptions.errorFunction (package:analysis_server/src/server/driver.dart:557:15)
#4 _Zone._processUncaughtError (dart:async/zone.dart:1178:14)
#5 _CustomZone.handleUncaughtError (dart:async/zone.dart:1399:5)
#6 Future._propagateToListeners (dart:async/future_impl.dart:832:24)
#7 Future._completeError (dart:async/future_impl.dart:730:5)
<asynchronous suspension>
Unhandled exception:
type '_ConstructorNameWithInvalidTypeArgs' is not a subtype of type 'ConstructorNameImpl?' in type cast
#0 AstBuilder.handleEnumElement (package:analyzer/src/fasta/ast_builder.dart:4091:32)
#1 Parser.parseEnumElement (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2665:14)
#2 Parser.parseEnum (package:_fe_analyzer_shared/src/parser/parser_impl.dart:2422:17)
#3 Parser.parseTopLevelKeywordDeclaration (package:_fe_analyzer_shared/src/parser/parser_impl.dart:687:14)
#4 Parser.parseTopLevelDeclarationImpl (package:_fe_analyzer_shared/src/parser/parser_impl.dart:533:14)
#5 Parser.parseUnit (package:_fe_analyzer_shared/src/parser/parser_impl.dart:411:15)
#6 Parser.parseCompilationUnit2 (package:analyzer/src/generated/parser.dart:100:32)
#7 Parser.parseCompilationUnit (package:analyzer/src/generated/parser.dart:96:12)
#8 FileState.parseCode.<anonymous closure> (package:analyzer/src/dart/analysis/file_state.dart:697:25)
#9 OperationPerformanceImpl.run (package:analyzer/src/util/performance/operation_performance.dart:155:23)
#10 FileState.parseCode (package:analyzer/src/dart/analysis/file_state.dart:671:24)
#11 FileState.getParsed (package:analyzer/src/dart/analysis/file_state.dart:628:16)
#12 FileState._getUnlinkedUnit (package:analyzer/src/dart/analysis/file_state.dart:905:16)
#13 FileState.refresh.<anonymous closure> (package:analyzer/src/dart/analysis/file_state.dart:746:29)
#14 OperationPerformanceImpl.run (package:analyzer/src/util/performance/operation_performance.dart:155:23)
#15 FileState.refresh (package:analyzer/src/dart/analysis/file_state.dart:745:17)
#16 FileSystemState._newFile.<anonymous closure> (package:analyzer/src/dart/analysis/file_state.dart:1709:12)
#17 OperationPerformanceImpl.run (package:analyzer/src/util/performance/operation_performance.dart:155:23)
#18 FileSystemState._newFile (package:analyzer/src/dart/analysis/file_state.dart:1708:17)
#19 FileSystemState.getFileForPath (package:analyzer/src/dart/analysis/file_state.dart:1502:14)
#20 AnalysisDriver._discoverLibraries (package:analyzer/src/dart/analysis/driver.dart:1671:16)
#21 AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1188:5)
#22 AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2431:24)
<asynchronous suspension>
Bad state: The analysis server crashed unexpectedly
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.crashProcess exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)