Chromium Code Reviews| Index: tests/language/closure_type_variables_test.dart |
| diff --git a/tests/language/type_variable_static_context_negative_test.dart b/tests/language/closure_type_variables_test.dart |
| similarity index 57% |
| copy from tests/language/type_variable_static_context_negative_test.dart |
| copy to tests/language/closure_type_variables_test.dart |
| index 1ac8e25b975307fb453cb871ade1e58d97fa97b1..abe8589b64e3d3c77c80b000588ac761197adb14 100644 |
| --- a/tests/language/type_variable_static_context_negative_test.dart |
| +++ b/tests/language/closure_type_variables_test.dart |
| @@ -2,14 +2,17 @@ |
| // 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. |
| -// A type variable can't be referenced in a static class |
| +// Test that type variables are available in closures. |
|
ngeoffray
2012/09/03 14:03:36
Maybe also add corner cases like doing it in a con
|
| class A<T> { |
| - static int method() { |
| - var foo = new T(); // error, can't reference a type variable in a static context |
| + foo() { |
| + g() { |
| + return new A<T>(); |
| + } |
| + return g(); |
| } |
| } |
| main() { |
| - A.method(); |
| + Expect.isTrue(new A<int>().foo() is A<int>); |
| } |