| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 95f6edf66847c00e75b51e90cd6dd3c8bb889abc..f210969e496d41a8f37238b7de316cdfd0e80dea 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -2615,6 +2615,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| world.registerStaticUse(constructor.declaration);
|
| ClassElement cls = constructor.getEnclosingClass();
|
| InterfaceType type = mapping.getType(node);
|
| + if (node.isConst() && type.containsTypeVariables) {
|
| + compiler.reportErrorCode(node.send.selector,
|
| + MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| + }
|
| world.registerInstantiatedType(type, mapping);
|
| if (constructor.isFactoryConstructor() && !type.typeArguments.isEmpty) {
|
| world.registerFactoryWithTypeArguments(mapping);
|
| @@ -2723,6 +2727,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
| DartType listType;
|
| if (typeArgument != null) {
|
| + if (node.isConst() && typeArgument.containsTypeVariables) {
|
| + compiler.reportErrorCode(arguments.nodes.head,
|
| + MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| + }
|
| listType = new InterfaceType(compiler.listClass,
|
| new Link<DartType>.fromList([typeArgument]));
|
| } else {
|
| @@ -2938,6 +2946,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| compiler.mapClass.computeType(compiler);
|
| mapType = compiler.mapClass.rawType;
|
| }
|
| + if (node.isConst() && mapType.containsTypeVariables) {
|
| + compiler.reportErrorCode(arguments,
|
| + MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| + }
|
| mapping.setType(node, mapType);
|
| world.registerInstantiatedClass(compiler.mapClass, mapping);
|
| if (node.isConst()) {
|
|
|