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

Unified Diff: tests/language/generic_test.dart

Issue 10280007: Check upper bounds of type arguments when allocating objects of a generic type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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
Index: tests/language/generic_test.dart
===================================================================
--- tests/language/generic_test.dart (revision 7209)
+++ tests/language/generic_test.dart (working copy)
@@ -56,19 +56,14 @@
E e = new E(); // Throws a type error, if type checks are enabled.
} catch (TypeError error) {
result = 1;
- // TODO(regis): The error below is detected too late.
- // It should be reported on line 31, at new B<T>(), i.e. new B<AX>().
- // This will be detected when we check the subtyping constraints.
- Expect.equals("A", error.dstType);
- Expect.equals("AX", error.srcType);
int pos = error.url.lastIndexOf("/", error.url.length);
if (pos == -1) {
pos = error.url.lastIndexOf("\\", error.url.length);
}
String subs = error.url.substring(pos + 1, error.url.length);
Expect.equals("generic_test.dart", subs);
- Expect.equals(23, error.line);
- Expect.equals(23, error.column);
+ Expect.equals(31, error.line); // new B<T>(t); AX does not extend A.
+ Expect.equals(17, error.column);
}
return result;
}
« runtime/vm/object.cc ('K') | « runtime/vm/parser.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698