Chromium Code Reviews| Index: tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart |
| diff --git a/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart b/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..263a2bcc7b94ff7f572e8383cb28d69ed504c58c |
| --- /dev/null |
| +++ b/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart |
| @@ -0,0 +1,25 @@ |
| +// Copyright (c) 2012, 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 |
| + |
| +// This te |
|
scheglov
2012/01/31 20:56:19
not finished comment
|
| + |
| +class A { |
| + static func() { return "class A"; } |
| +} |
| + |
| +class B<T> { |
| + doFunc() { |
| + T.func(); // illegal to use type variable as an identifier expression |
| + } |
| +} |
| + |
| +main() { |
| + try { |
| + var buf = new B<A>().doFunc(); |
| + print(buf); |
| + } catch (Exception e) { |
| + // should be an uncatchable compile-time error, |
| + } |
| +} |