From 72d7e5b0ce1a987e95bc4c58f56399f62088d813 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Mon, 7 Feb 2022 19:03:25 +0000 Subject: [PATCH] [ddc] Cleanup non-nullable experiment flag Also remove dead code that was a workaround when there were two forks of the SDK libraries but one version the dart:_runtime. Change-Id: I1192fcc5238fb84ab1cda533bee8bef63d289a2e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231743 Reviewed-by: Sigmund Cherem Commit-Queue: Nicholas Shahan --- pkg/dev_compiler/lib/src/compiler/shared_command.dart | 3 --- pkg/dev_compiler/lib/src/kernel/command.dart | 4 ++-- pkg/dev_compiler/lib/src/kernel/compiler.dart | 9 +-------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart index 77fc6154096..f70d35bfe00 100644 --- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart +++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart @@ -238,9 +238,6 @@ class SharedCompilerOptions { // that build systems do not depend on passing windows-style paths here. return p.toUri(moduleName).toString(); } - - // TODO(nshahan) Cleanup when NNBD graduates experimental status. - bool get enableNullSafety => experiments['non-nullable'] ?? false; } /// Finds explicit module names of the form `path=name` in [summaryPaths], diff --git a/pkg/dev_compiler/lib/src/kernel/command.dart b/pkg/dev_compiler/lib/src/kernel/command.dart index e0a610ae1cd..605c339bf9f 100644 --- a/pkg/dev_compiler/lib/src/kernel/command.dart +++ b/pkg/dev_compiler/lib/src/kernel/command.dart @@ -276,7 +276,7 @@ Future _compile(List args, additionalDills, DevCompilerTarget(TargetFlags( trackWidgetCreation: trackWidgetCreation, - enableNullSafety: options.enableNullSafety)), + enableNullSafety: options.soundNullSafety)), fileSystem: fileSystem, explicitExperimentalFlags: explicitExperimentalFlags, environmentDefines: declaredVariables, @@ -315,7 +315,7 @@ Future _compile(List args, inputDigests, DevCompilerTarget(TargetFlags( trackWidgetCreation: trackWidgetCreation, - enableNullSafety: options.enableNullSafety)), + enableNullSafety: options.soundNullSafety)), fileSystem: fileSystem, explicitExperimentalFlags: explicitExperimentalFlags, environmentDefines: declaredVariables, diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart index 3255b97debe..3919691fa0f 100644 --- a/pkg/dev_compiler/lib/src/kernel/compiler.dart +++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart @@ -3013,14 +3013,7 @@ class ProgramCompiler extends ComputeOnceConstantVisitor // * `class A extends B {...}` where B is the InterfaceType. // * Emitting non-null constructor calls. // * The InterfaceType is the Null type. - // * The types were written in JS context or as part of the dart:_runtime - // library. - if (!emitNullability || - type == _coreTypes.deprecatedNullType || - // TODO(38701) Remove these once the SDK has unforked and is running - // "opted-in" - !coreLibrary.isNonNullableByDefault && - (_isInForeignJS || isSdkInternalRuntime(currentLibrary))) { + if (!emitNullability || type == _coreTypes.deprecatedNullType) { return typeRep; }