Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1563)

Unified Diff: frog/value.dart

Issue 8567016: Fix a spurious warning in Frog selfhost (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/member.dart ('k') | frog/var_member.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}?');
}
« no previous file with comments | « frog/member.dart ('k') | frog/var_member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698