Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test that type variables aren't in scope of static methods and factories. | 5 // Test that type variables aren't in scope of static methods and factories. |
| 6 | 6 |
| 7 class Foo<T> { | 7 class Foo<T> { |
| 8 // T is not in scope for a static method. | 8 // T is not in scope for a static method. |
| 9 static | 9 static |
| 10 Foo<T> /// 00: compile-time error | 10 Foo<T> /// 00: compile-time error |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 Foo<T> /// 07: compile-time error | 32 Foo<T> /// 07: compile-time error |
| 33 value) {} | 33 value) {} |
| 34 } | 34 } |
| 35 | 35 |
| 36 interface I<X> factory Foo<X> { | 36 interface I<X> factory Foo<X> { |
| 37 I(I<X> i); | 37 I(I<X> i); |
| 38 } | 38 } |
| 39 | 39 |
| 40 main() { | 40 main() { |
| 41 Foo.m(null); | 41 Foo.m(null); |
| 42 new I(null); | |
|
jimhug
2011/10/31 23:36:31
Without this call, error #04 may not be detected b
ngeoffray
2011/11/01 08:17:34
OK.
| |
| 42 } | 43 } |
| OLD | NEW |