Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
index b242c98e140d4a3a58feb1fb02e2585b75769ba2..d394bb7c3dbba41ebd3944c6d0d3442792df9e12 100644 |
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart |
@@ -373,9 +373,11 @@ abstract class InferrerEngine<T, V extends TypeSystem> |
mappedType = types.stringType; |
} else if (type.element == compiler.intClass) { |
mappedType = types.intType; |
- } else if (type.element == compiler.doubleClass) { |
- mappedType = types.doubleType; |
- } else if (type.element == compiler.numClass) { |
+ } else if (type.element == compiler.numClass || |
+ type.element == compiler.doubleClass) { |
+ // Note: the backend double class is specifically for non-integer |
+ // doubles, and a native behavior returning 'double' does not guarantee |
+ // a non-integer return type, so we return the number type for those. |
mappedType = types.numType; |
} else if (type.element == compiler.boolClass) { |
mappedType = types.boolType; |