| Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| index e27f146fcbddbc3aa135fc3f87938394275f8568..fa7c79507ad735d6cc91024d1e91cff5723b0953 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
|
| @@ -393,6 +393,18 @@ public class ResolverTest extends ResolverTestCase {
|
| "}"),
|
| ResolverErrorCode.NEW_EXPRESSION_CANT_USE_TYPE_VAR);
|
| }
|
| +
|
| + public void testConstExpression4() {
|
| + // New expression tied to an unbound type variable is not allowed.
|
| + resolveAndTest(Joiner.on("\n").join(
|
| + "class Object {}",
|
| + "class Foo<T> {",
|
| + " T create() {",
|
| + " return const T();",
|
| + " }",
|
| + "}"),
|
| + ResolverErrorCode.CONST_EXPRESSION_CANT_USE_TYPE_VAR);
|
| + }
|
|
|
| public void testNewExpression5() {
|
| // More cowbell. (Foo<T> isn't a type yet)
|
|
|