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 @@ -4699,14 +4699,16 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
4699
4699
js_ast.Statement visitAssertStatement (AssertStatement node) {
4700
4700
if (! _options.enableAsserts) return js_ast.EmptyStatement ();
4701
4701
var condition = node.condition;
4702
- var conditionType = condition.getStaticType (_staticTypeContext);
4702
+ var conditionType =
4703
+ condition.getStaticType (_staticTypeContext).extensionTypeErasure;
4703
4704
var jsCondition = _visitExpression (condition);
4704
4705
4705
4706
if (conditionType != _coreTypes.boolLegacyRawType &&
4706
4707
conditionType != _coreTypes.boolNullableRawType &&
4707
4708
conditionType != _coreTypes.boolNonNullableRawType) {
4708
4709
jsCondition = runtimeCall ('dtest(#)' , [jsCondition]);
4709
4710
} else if (isNullable (condition)) {
4711
+ // TODO(nshahan): Is this branch even reachable in null safe code?
4710
4712
jsCondition = runtimeCall ('test(#)' , [jsCondition]);
4711
4713
}
4712
4714
You can’t perform that action at this time.
0 commit comments