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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/types.dart

Issue 11361060: Support checked mode for return type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/types.dart (revision 14515)
+++ sdk/lib/_internal/compiler/implementation/ssa/types.dart (working copy)
@@ -216,8 +216,8 @@
HType intersection(HType other, Compiler compiler) {
if (other.isConflicting()) return HType.CONFLICTING;
if (other.isUnknown()) return HType.BOOLEAN_OR_NULL;
+ if (other.isBoolean()) return HType.BOOLEAN;
if (other.isBooleanOrNull()) return HType.BOOLEAN_OR_NULL;
- if (other.isBoolean()) return HType.BOOLEAN;
if (other.canBeNull()) return HType.NULL;
return HType.CONFLICTING;
}
@@ -226,6 +226,7 @@
class HBooleanType extends HPrimitiveType {
const HBooleanType();
bool isBoolean() => true;
+ bool isBooleanOrNull() => true;
String toString() => "boolean";
DartType computeType(Compiler compiler) {
@@ -285,6 +286,7 @@
class HNumberType extends HPrimitiveType {
const HNumberType();
bool isNumber() => true;
+ bool isNumberOrNull() => true;
String toString() => "number";
DartType computeType(Compiler compiler) {
@@ -334,8 +336,8 @@
HType intersection(HType other, Compiler compiler) {
if (other.isConflicting()) return HType.CONFLICTING;
if (other.isUnknown()) return HType.INTEGER_OR_NULL;
+ if (other.isInteger()) return HType.INTEGER;
if (other.isIntegerOrNull()) return HType.INTEGER_OR_NULL;
- if (other.isInteger()) return HType.INTEGER;
if (other.isDouble()) return HType.CONFLICTING;
if (other.isDoubleOrNull()) return HType.NULL;
if (other.isNumber()) return HType.INTEGER;
@@ -348,6 +350,7 @@
class HIntegerType extends HNumberType {
const HIntegerType();
bool isInteger() => true;
+ bool isIntegerOrNull() => true;
String toString() => "integer";
DartType computeType(Compiler compiler) {
@@ -401,8 +404,8 @@
HType intersection(HType other, Compiler compiler) {
if (other.isConflicting()) return HType.CONFLICTING;
if (other.isUnknown()) return HType.DOUBLE_OR_NULL;
+ if (other.isInteger()) return HType.CONFLICTING;
if (other.isIntegerOrNull()) return HType.NULL;
- if (other.isInteger()) return HType.CONFLICTING;
if (other.isDouble()) return HType.DOUBLE;
if (other.isDoubleOrNull()) return HType.DOUBLE_OR_NULL;
if (other.isNumber()) return HType.DOUBLE;
@@ -415,6 +418,7 @@
class HDoubleType extends HNumberType {
const HDoubleType();
bool isDouble() => true;
+ bool isDoubleOrNull() => true;
String toString() => "double";
DartType computeType(Compiler compiler) {
@@ -529,6 +533,7 @@
class HStringType extends HIndexablePrimitiveType {
const HStringType();
bool isString() => true;
+ bool isStringOrNull() => true;
String toString() => "String";
DartType computeType(Compiler compiler) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698