Skip to content

Commit 2e438d1

Browse files
nshahancommit-bot@chromium.org
authored andcommitted
[ddc] Add temporary fix for typeAcceptsNull()
The CFE is evaluating the constant as if strong mode is always enabled. This is a temporary work around and we should be able to access the mode flag here in a future change. Change-Id: I28842a692183c8da7aa42086a034f5388af83af5 Issue: dart-lang#41657 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144815 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent 5ed8847 commit 2e438d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sdk_nnbd/lib/_internal/js_dev_runtime/patch/internal_patch.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import 'dart:_interceptors' show JSArray;
1010
import 'dart:_foreign_helper' show JS;
1111
import 'dart:_runtime' as dart;
1212

13+
// TODO(41657) Make a constant when CFE evaluates in the null safety mode.
14+
var isLegacySubtyping = const <Null>[] is List<int>;
15+
1316
@patch
1417
bool typeAcceptsNull<T>() {
15-
const isLegacySubtyping = <Null>[] is List<int>;
1618
return isLegacySubtyping || null is T;
1719
}
1820

0 commit comments

Comments
 (0)