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

Unified Diff: tests/language/type_variable_scope_test.dart

Issue 10408077: Fix bad language tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_variable_scope_test.dart
===================================================================
--- tests/language/type_variable_scope_test.dart (revision 7883)
+++ tests/language/type_variable_scope_test.dart (working copy)
@@ -1,42 +1,47 @@
// 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 that type variables aren't in scope of static methods and factories.
class Foo<T> {
+ Foo() { }
+
// T is not in scope for a static method.
static
- Foo<T> /// 00: compile-time error
+ Foo<T> /// 00: dynamic type error
m(
- Foo<T> /// 01: compile-time error
+ Foo<T> /// 01: dynamic type error
f) {
- I<T> x; /// 02: compile-time error
+ Foo<T> x = new Foo<String>(); /// 02: dynamic type error
+ return new Foo<String>();
}
// T is in scope for a factory method.
- factory I(I<T> i) {
- I<T> x;
+ factory I(Foo<T> f) {
+ Foo<T> x = f;
}
// T is not in scope for a static field.
- static Foo<T> f1; /// 03: compile-time error
+ static Foo<T> f1; /// 03: dynamic type error
static
- Foo<T> /// 04: compile-time error
- get f() { return null; }
+ Foo<T> /// 04: dynamic type error
+ get f() { return new Foo<String>(); }
static void set f(
- Foo<T> /// 05: compile-time error
+ Foo<T> /// 05: dynamic type error
value) {}
}
interface I<T> default Foo<T> {
- I(I<T> i);
+ I(Foo<T> f);
}
main() {
- Foo.m(null);
- new I(null);
+ Foo.m(new Foo<String>());
+ new I(new Foo<String>());
+ Foo.f1 = new Foo<String>(); /// 03: continued
+ var x = Foo.f;
+ Foo.f = x;
}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698