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

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

Issue 8585004: Support correct factory syntax in the VM as decribed in the spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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
Index: tests/language/src/TypeVariableBoundsTest.dart
===================================================================
--- tests/language/src/TypeVariableBoundsTest.dart (revision 1585)
+++ tests/language/src/TypeVariableBoundsTest.dart (working copy)
@@ -1,14 +1,15 @@
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--enable_type_checks
// Test of parameterized factory methods.
-class Foo<F extends num> {
+class Foo<T extends num> {
Foo();
// F is not assignable to num.
- factory IFoo<F extends String>.bad() { return null; } /// 00: compile-time error
+ factory IFoo<F extends String>.bad() { return null; } /// 00: static type error
factory IFoo<F extends num>.good() { return null; }
@@ -16,15 +17,9 @@
factory IFoo<F>.ish() { return null; }
}
-interface IFoo<X extends num> factory Foo {
+interface IFoo<X extends num> factory Foo<T extends num> {
}
-class FBound<F extends FBound<F>> {}
-
-class Bar extends FBound<Bar> {}
-
-class SubBar extends Bar {}
-
// String is not assignable to num.
class Baz extends Foo<String> {} /// 01: compile-time error
@@ -33,28 +28,26 @@
Foo<int> fi;
// String is not assignable to num.
-Foo<String> fs; /// 02: static type error
+Foo<String> fs; /// 02: compile-time error
-FBound<SubBar> fb; /// 03: static type error
-
class Box<T> {
// Box.T is not assignable to num.
- Foo<T> t; /// 04: static type error
+ Foo<T> t; /// 03: static type error
makeFoo() {
// Box.T is not assignable to num.
- return new Foo<T>(); /// 05: compile-time error
+ return new Foo<T>(); /// 04: static type error
}
}
class TypeVariableBoundsTest {
static testMain() {
// String is not assignable to num.
- var v1 = new Foo<String>(); /// 06: compile-time error
+ var v1 = new Foo<String>(); /// 05: compile-time error
// String is not assignable to num.
- Foo<String> v2 = null; /// 07: static type error
+ Foo<String> v2 = null; /// 06: compile-time error
}
}

Powered by Google App Engine
This is Rietveld 408576698