| Index: frog/value.dart
|
| diff --git a/frog/value.dart b/frog/value.dart
|
| index 91b37b413ec388a01d02eadb0783c3e18927be83..2c06880c282163a7e61e13cc0f445dedad9804f6 100644
|
| --- a/frog/value.dart
|
| +++ b/frog/value.dart
|
| @@ -210,7 +210,7 @@ class Value {
|
| }
|
| if (options.enableTypeChecks) {
|
| Type fromType = type;
|
| - if (type.isVar && code != 'null') {
|
| + if (type.isVar && (code != 'null' || !toType.isNullable)) {
|
| fromType = world.objectType;
|
| }
|
| bool bothNum = type.isNum && toType.isNum;
|
| @@ -265,7 +265,7 @@ class Value {
|
| // TODO(jmesserly): remove the special case for "num" when our num handling
|
| // is better.
|
| bool bothNum = type.isNum && toType.isNum;
|
| - if (!checked || fromType.isSubtypeOf(toType) || bothNum) {
|
| + if (fromType.isSubtypeOf(toType) || bothNum) {
|
| // No checks needed for a widening conversion.
|
| return this;
|
| }
|
| @@ -303,6 +303,12 @@ class Value {
|
| toType = p.extendsType;
|
| }
|
|
|
| + // TODO(jmesserly): fix checking of function types.
|
| + // For now, don't generate a broken check.
|
| + if (toType.getCallMethod() != null) {
|
| + return this;
|
| + }
|
| +
|
| if (toType.isObject || toType.isVar) {
|
| world.internalError('We thought ${type.name} is not a subtype of ${toType.name}?');
|
| }
|
|
|