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

Unified Diff: tests/compiler/dart2js/type_checker_test.dart

Issue 12385079: Handle void correctly in function subtyping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 9 months 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 | « tests/co19/co19-dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_checker_test.dart
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 39e688a350d2f7eaf240d10bb8e395d19f367e44..5e43e605c2c24ac09efa0070579f4c651a39ee0e 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -16,6 +16,7 @@ import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart';
+DartType voidType;
DartType intType;
DartType boolType;
DartType stringType;
@@ -508,9 +509,15 @@ testFunctionSubtyping() {
const Link<DartType>(),
const Link<SourceString>(), const Link<DartType>()));
}
+ Expect.isTrue(isSubtype([], intType, [], voidType));
+ Expect.isFalse(isSubtype([], voidType, [], intType));
+ Expect.isTrue(isSubtype([], voidType, [], voidType));
Expect.isTrue(isSubtype([], intType, [], intType));
Expect.isTrue(isSubtype([], intType, [], objectType));
Expect.isFalse(isSubtype([], intType, [], doubleType));
+ Expect.isFalse(isSubtype([], intType, [intType], voidType));
+ Expect.isFalse(isSubtype([], voidType, [intType], intType));
+ Expect.isFalse(isSubtype([], voidType, [intType], voidType));
Expect.isTrue(isSubtype([intType], intType, [intType], intType));
Expect.isTrue(isSubtype([objectType], intType, [intType], objectType));
Expect.isFalse(isSubtype([intType], intType, [doubleType], intType));
@@ -680,6 +687,7 @@ Node parseExpression(String text) =>
void setup() {
compiler = new MockCompiler();
types = compiler.types;
+ voidType = compiler.types.voidType;
intType = compiler.intClass.computeType(compiler);
doubleType = compiler.doubleClass.computeType(compiler);
boolType = compiler.boolClass.computeType(compiler);
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698