File tree 1 file changed +3
-1
lines changed
pkg/dev_compiler/lib/src/kernel
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import 'package:kernel/kernel.dart' hide MapEntry;
12
12
import 'package:kernel/library_index.dart' ;
13
13
import 'package:kernel/type_algebra.dart' ;
14
14
import 'package:kernel/type_environment.dart' ;
15
+ import 'package:kernel/src/dart_type_equivalence.dart' ;
15
16
import 'package:source_span/source_span.dart' show SourceLocation;
16
17
import 'package:path/path.dart' as p;
17
18
@@ -5331,7 +5332,8 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
5331
5332
}
5332
5333
5333
5334
if (! isTypeError &&
5334
- from.withDeclaredNullability (Nullability .nonNullable) == to &&
5335
+ DartTypeEquivalence (_coreTypes, ignoreTopLevelNullability: true )
5336
+ .areEqual (from, to) &&
5335
5337
_mustBeNonNullable (to)) {
5336
5338
// If the underlying type is the same, we only need a null check.
5337
5339
return runtimeCall ('nullCast(#, #)' , [jsFrom, _emitType (to)]);
You can’t perform that action at this time.
0 commit comments