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

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

Issue 52263003: Implement least upper bound. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 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 | « tests/compiler/dart2js/least_upper_bound_test.dart ('k') | tests/compiler/dart2js/type_promotion_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index a0d433eee90f2d6b2cd6c845277f48f003700170..9cdd4d77ea850a767e8340a045ce81f6b09dc7e1 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -646,10 +646,20 @@ resolveConstructor(String script, String statement, String className,
testClassHierarchy() {
final MAIN = "main";
MockCompiler compiler = new MockCompiler();
+ compiler.parseScript("""class A extends A {}
+ main() { return new A(); }""");
+ FunctionElement mainElement = compiler.mainApp.find(MAIN);
+ compiler.resolver.resolve(mainElement);
+ Expect.equals(0, compiler.warnings.length);
+ Expect.equals(1, compiler.errors.length);
+ Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY,
+ compiler.errors[0].message.kind);
+
+ compiler = new MockCompiler();
compiler.parseScript("""class A extends B {}
class B extends A {}
main() { return new A(); }""");
- FunctionElement mainElement = compiler.mainApp.find(MAIN);
+ mainElement = compiler.mainApp.find(MAIN);
compiler.resolver.resolve(mainElement);
Expect.equals(0, compiler.warnings.length);
Expect.equals(2, compiler.errors.length);
@@ -714,6 +724,17 @@ testClassHierarchy() {
supertypes = aElement.allSupertypes;
Expect.equals(<String>['A<E>', 'D', 'Object'].toString(),
asSortedStrings(supertypes).toString());
+
+ compiler = new MockCompiler();
+ compiler.parseScript("""class A<T> {}
+ class D extends A<int> implements A<double> {}
+ main() { return new D(); }""");
+ mainElement = compiler.mainApp.find(MAIN);
+ compiler.resolver.resolve(mainElement);
+ Expect.equals(0, compiler.warnings.length);
+ Expect.equals(1, compiler.errors.length);
+ Expect.equals(MessageKind.MULTI_INHERITANCE,
+ compiler.errors[0].message.kind);
}
testInitializers() {
« no previous file with comments | « tests/compiler/dart2js/least_upper_bound_test.dart ('k') | tests/compiler/dart2js/type_promotion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698