@@ -14,8 +14,7 @@ import 'package:kernel/binary/ast_from_binary.dart'
1414 CompilationModeError,
1515 InvalidKernelSdkVersionError,
1616 InvalidKernelVersionError,
17- SubComponentView,
18- mergeCompilationModeOrThrow;
17+ SubComponentView;
1918import 'package:kernel/canonical_name.dart'
2019 show CanonicalNameError, CanonicalNameSdkError;
2120import 'package:kernel/class_hierarchy.dart'
@@ -39,7 +38,6 @@ import 'package:kernel/kernel.dart'
3938 Name,
4039 NamedNode,
4140 Node,
42- NonNullableByDefaultCompiledMode,
4341 Procedure,
4442 ProcedureKind,
4543 Reference,
@@ -492,14 +490,9 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
492490 data.component? .mainMethod
493491 : componentWithDill.mainMethod;
494492 // ignore: unnecessary_null_comparison
495- NonNullableByDefaultCompiledMode ? compiledMode = componentWithDill == null
496- ?
497- // Coverage-ignore(suite): Not run.
498- data.component? .mode
499- : componentWithDill.mode;
500493 Component result = context.options.target.configureComponent (
501494 new Component (libraries: outputLibraries, uriToSource: uriToSource))
502- ..setMainMethodAndMode (mainMethod? .reference, true , compiledMode ! )
495+ ..setMainMethodAndMode (mainMethod? .reference, true )
503496 ..problemsAsJson = problemsAsJson;
504497
505498 // Copy the metadata *just created*. This will likely not contain metadata
@@ -944,28 +937,9 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
944937 _dillLoadedData! .loader.currentSourceLoader = kernelTarget.loader;
945938
946939 // Re-use the libraries we've deemed re-usable.
947- List <bool > seenModes = [false , false , false , false ];
948940 for (DillLibraryBuilder library in reusedLibraries) {
949- seenModes[library.library.nonNullableByDefaultCompiledMode.index] = true ;
950941 kernelTarget.loader.registerLoadedDillLibraryBuilder (library);
951942 }
952- // Check compilation mode up against what we've seen here and set
953- // `hasInvalidNnbdModeLibrary` accordingly.
954- if (c.options.globalFeatures.nonNullable.isEnabled) {
955- // Don't expect weak or invalid.
956- if (seenModes[NonNullableByDefaultCompiledMode .Weak .index] ||
957- seenModes[NonNullableByDefaultCompiledMode .Invalid .index]) {
958- // Coverage-ignore-block(suite): Not run.
959- kernelTarget.loader.hasInvalidNnbdModeLibrary = true ;
960- }
961- } else {
962- // Coverage-ignore-block(suite): Not run.
963- // Don't expect strong or invalid.
964- if (seenModes[NonNullableByDefaultCompiledMode .Strong .index] ||
965- seenModes[NonNullableByDefaultCompiledMode .Invalid .index]) {
966- kernelTarget.loader.hasInvalidNnbdModeLibrary = true ;
967- }
968- }
969943
970944 // The entry point(s) has to be set first for loader.firstUri to be setup
971945 // correctly.
@@ -2491,8 +2465,7 @@ class _InitializationFromComponent extends _InitializationStrategy {
24912465 .mainMethod
24922466 // Coverage-ignore(suite): Not run.
24932467 ? .reference,
2494- true ,
2495- componentToInitializeFrom.mode);
2468+ true );
24962469 componentProblems.saveComponentProblems (component);
24972470
24982471 bool foundDartCore = false ;
@@ -2621,10 +2594,6 @@ class _InitializationFromUri extends _InitializationFromSdkSummary {
26212594 .readComponent (data.component! ,
26222595 checkCanonicalNames: true , createView: true )! ;
26232596
2624- // Compute "output nnbd mode".
2625- NonNullableByDefaultCompiledMode compiledMode =
2626- NonNullableByDefaultCompiledMode .Strong ;
2627-
26282597 // Check the any package-urls still point to the same file
26292598 // (e.g. the package still exists and hasn't been updated).
26302599 // Also verify NNBD settings.
@@ -2638,16 +2607,6 @@ class _InitializationFromUri extends _InitializationFromSdkSummary {
26382607 // For now just don't initialize from this dill.
26392608 throw const PackageChangedError ();
26402609 }
2641- // Note: If a library has a NonNullableByDefaultCompiledMode.invalid
2642- // we will throw and we won't initialize from it.
2643- // That's wanted behavior.
2644- if (compiledMode !=
2645- mergeCompilationModeOrThrow (
2646- compiledMode, lib.nonNullableByDefaultCompiledMode)) {
2647- throw new CompilationModeError (
2648- "Can't compile to $compiledMode with library with mode "
2649- "${lib .nonNullableByDefaultCompiledMode }." );
2650- }
26512610 }
26522611
26532612 // Only initialize the incremental serializer when we know we'll
0 commit comments