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

Fasta crash: Type Library is not a subtype of Class #29986

Open lukechurch opened 7 years ago

lukechurch commented 7 years ago

@peter-ahe-google ID: bc938b5b3ac246d077c263fa8cafd7fc6c0683d8

Unhandled exception:
type 'Library' is not a subtype of type 'Class' of 'enclosingClass' where
  Library is from package:kernel/ast.dart
  Class is from package:kernel/ast.dart

#0      TypeInferenceEngineImpl._inferInitializingFormalType (package:front_end/src/fasta/type_inference/type_inference_engine.dart:392:49)
#1      TypeInferenceEngineImpl.finishTopLevel (package:front_end/src/fasta/type_inference/type_inference_engine.dart:228:21)
#2      SourceLoader.performInitializerInference (package:front_end/src/fasta/source/source_loader.dart:483:25)
#3      KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:249:14)
<asynchronous suspension>
#4      CompileTask.buildOutline (package:front_end/src/fasta/fasta.dart:149:38)
<asynchronous suspension>
#5      CompileTask.compile (package:front_end/src/fasta/fasta.dart:161:39)
<asynchronous suspension>
#6      compile.<anonymous closure> (package:front_end/src/fasta/fasta.dart:101:25)
<asynchronous suspension>
#7      CompilerContext.withGlobalOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:45:33)
#8      _rootRun (dart:async/zone.dart:1120)
#9      _CustomZone.run (dart:async/zone.dart:1001)
#10     runZoned (dart:async/zone.dart:1467)
#11     CompilerContext.withGlobalOptions (package:front_end/src/fasta/compiler_context.dart:45:12)
#12     CompilerCommandLine.withGlobalOptions (package:front_end/src/fasta/compiler_command_line.dart:120:28)
#13     compile (package:front_end/src/fasta/fasta.dart:94:38)
<asynchronous suspension>
#14     compileEntryPoint (package:front_end/src/fasta/fasta.dart:53:11)
<asynchronous suspension>
#15     main (file:///home/lukechurch/GitRepos/dart-sdk/sdk/pkg/front_end/tool/_fasta/compile.dart:7:33)
#16     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:263)
#17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
peter-ahe-google commented 7 years ago

Repro:

main() {
}

C(this.name);
jensjoha commented 6 years ago

The repro code no longer crashes. Can we close? Update: Leaving open to make sure we have a regression test.

stereotype441 commented 1 year ago

Unassigning myself because I’m not actively working on this issue right now.

modulovalue commented 1 year ago

There's a testcase for this issue here https://github.com/dart-lang/sdk/blob/main/pkg/front_end/testcases/regress/issue_29986.dart, but this issue is still open, it looks like it can be closed? @jensjoha