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

Unified Diff: tests/language/src/TypeVariableBoundsTest.dart

Issue 8948001: Updates dartc to recognize 'default' keyword on interface and updated factory method syntax (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Feedback from mmendez Created 9 years 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/src/TypeVariableBoundsTest.dart
diff --git a/tests/language/src/TypeVariableBoundsTest.dart b/tests/language/src/TypeVariableBoundsTest.dart
index 7d526692d95eadef7de0f68df533975935c9f5bc..961acf6b4a6811c2a0a5e99f0cfbe5f0ac964d70 100644
--- a/tests/language/src/TypeVariableBoundsTest.dart
+++ b/tests/language/src/TypeVariableBoundsTest.dart
@@ -15,18 +15,22 @@ class Foo<T extends num> {
factory IFoo() { return null; }
}
-interface IFoo<T extends num> factory Foo<T extends num> {
+interface IFoo<T extends num> default Foo<T extends num> {
}
// String is not assignable to num.
-class Baz extends Foo<String> {} /// 01: compile-time error
+class Baz
+ extends Foo<String> /// 01: static type error
+{}
class Biz extends Foo<int> {}
Foo<int> fi;
// String is not assignable to num.
-Foo<String> fs; /// 02: compile-time error
+Foo
+ <String> /// 02: static type error
+ fs;
class Box<T> {
@@ -39,16 +43,32 @@ class Box<T> {
}
}
-class TypeVariableBoundsTest {
- static testMain() {
- // String is not assignable to num.
- var v1 = new Foo<String>(); /// 05: compile-time error
+main() {
+ // String is not assignable to num.
+ var v1 = new Foo<String>(); /// 05: static type error
- // String is not assignable to num.
- Foo<String> v2 = null; /// 06: compile-time error
- }
-}
+ // String is not assignable to num.
+ Foo<String> v2 = null; /// 06: static type error
-main() {
- TypeVariableBoundsTest.testMain();
+ new Baz();
+ new Biz();
+
+ fi = new Foo();
+ fs = new Foo();
+
+ new Box().makeFoo();
+ new Box<int>().makeFoo();
+ new Box<String>().makeFoo();
+
+ // Fisk does not exist.
+ new Box<Fisk>(); /// 07: compile-time error
+
+ // Too many type arguments.
+ new Box<Object, Object>(); /// 08: compile-time error
+
+ // Fisk does not exist.
+ Box<Fisk> box = null; /// 09: static type error
+
+ // Too many type arguments.
+ Box<Object, Object> box = null; /// 10: static type error
}
« no previous file with comments | « tests/language/src/NonParameterizedFactoryTest.dart ('k') | tests/stub-generator/src/MintMakerFullyIsolatedTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698