OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library dart2js.resolution; | 5 library dart2js.resolution; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 visitorFor(context, useEnclosingScope: true); | 1059 visitorFor(context, useEnclosingScope: true); |
1060 ResolutionRegistry registry = visitor.registry; | 1060 ResolutionRegistry registry = visitor.registry; |
1061 node.accept(visitor); | 1061 node.accept(visitor); |
1062 // TODO(johnniwinther): Avoid passing the [TreeElements] to | 1062 // TODO(johnniwinther): Avoid passing the [TreeElements] to |
1063 // [compileMetadata]. | 1063 // [compileMetadata]. |
1064 ConstantExpression constant = constantCompiler.compileMetadata( | 1064 ConstantExpression constant = constantCompiler.compileMetadata( |
1065 annotation, node, registry.mapping); | 1065 annotation, node, registry.mapping); |
1066 switch (constant.kind) { | 1066 switch (constant.kind) { |
1067 case ConstantExpressionKind.CONSTRUCTED: | 1067 case ConstantExpressionKind.CONSTRUCTED: |
1068 ConstructedConstantExpression constructedConstant = constant; | 1068 ConstructedConstantExpression constructedConstant = constant; |
1069 if (constructedConstant.type.isGeneric) { | 1069 if (constructedConstant.type.isGeneric && |
| 1070 !constructedConstant.type.isRaw) { |
1070 // Const constructor calls cannot have type arguments. | 1071 // Const constructor calls cannot have type arguments. |
1071 // TODO(24312): Remove this. | 1072 // TODO(24312): Remove this. |
1072 reporter.reportErrorMessage( | 1073 reporter.reportErrorMessage( |
1073 node, MessageKind.INVALID_METADATA_GENERIC); | 1074 node, MessageKind.INVALID_METADATA_GENERIC); |
1074 constant = new ErroneousConstantExpression(); | 1075 constant = new ErroneousConstantExpression(); |
1075 } | 1076 } |
1076 break; | 1077 break; |
1077 case ConstantExpressionKind.VARIABLE: | 1078 case ConstantExpressionKind.VARIABLE: |
1078 case ConstantExpressionKind.ERRONEOUS: | 1079 case ConstantExpressionKind.ERRONEOUS: |
1079 break; | 1080 break; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 TreeElements get treeElements { | 1123 TreeElements get treeElements { |
1123 assert(invariant(this, _treeElements != null, | 1124 assert(invariant(this, _treeElements != null, |
1124 message: "TreeElements have not been computed for $this.")); | 1125 message: "TreeElements have not been computed for $this.")); |
1125 return _treeElements; | 1126 return _treeElements; |
1126 } | 1127 } |
1127 | 1128 |
1128 void reuseElement() { | 1129 void reuseElement() { |
1129 _treeElements = null; | 1130 _treeElements = null; |
1130 } | 1131 } |
1131 } | 1132 } |
OLD | NEW |