| 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 visitorFor(context, useEnclosingScope: true); | 1076 visitorFor(context, useEnclosingScope: true); |
| 1077 ResolutionRegistry registry = visitor.registry; | 1077 ResolutionRegistry registry = visitor.registry; |
| 1078 node.accept(visitor); | 1078 node.accept(visitor); |
| 1079 // TODO(johnniwinther): Avoid passing the [TreeElements] to | 1079 // TODO(johnniwinther): Avoid passing the [TreeElements] to |
| 1080 // [compileMetadata]. | 1080 // [compileMetadata]. |
| 1081 ConstantExpression constant = constantCompiler.compileMetadata( | 1081 ConstantExpression constant = constantCompiler.compileMetadata( |
| 1082 annotation, node, registry.mapping); | 1082 annotation, node, registry.mapping); |
| 1083 switch (constant.kind) { | 1083 switch (constant.kind) { |
| 1084 case ConstantExpressionKind.CONSTRUCTED: | 1084 case ConstantExpressionKind.CONSTRUCTED: |
| 1085 ConstructedConstantExpression constructedConstant = constant; | 1085 ConstructedConstantExpression constructedConstant = constant; |
| 1086 if (constructedConstant.type.isGeneric && | 1086 ResolutionInterfaceType type = constructedConstant.type; |
| 1087 !constructedConstant.type.isRaw) { | 1087 if (type.isGeneric && !type.isRaw) { |
| 1088 // Const constructor calls cannot have type arguments. | 1088 // Const constructor calls cannot have type arguments. |
| 1089 // TODO(24312): Remove this. | 1089 // TODO(24312): Remove this. |
| 1090 reporter.reportErrorMessage( | 1090 reporter.reportErrorMessage( |
| 1091 node, MessageKind.INVALID_METADATA_GENERIC); | 1091 node, MessageKind.INVALID_METADATA_GENERIC); |
| 1092 constant = new ErroneousConstantExpression(); | 1092 constant = new ErroneousConstantExpression(); |
| 1093 } | 1093 } |
| 1094 break; | 1094 break; |
| 1095 case ConstantExpressionKind.VARIABLE: | 1095 case ConstantExpressionKind.FIELD: |
| 1096 case ConstantExpressionKind.ERRONEOUS: | 1096 case ConstantExpressionKind.ERRONEOUS: |
| 1097 break; | 1097 break; |
| 1098 default: | 1098 default: |
| 1099 reporter.reportErrorMessage( | 1099 reporter.reportErrorMessage( |
| 1100 node, MessageKind.INVALID_METADATA); | 1100 node, MessageKind.INVALID_METADATA); |
| 1101 constant = new ErroneousConstantExpression(); | 1101 constant = new ErroneousConstantExpression(); |
| 1102 break; | 1102 break; |
| 1103 } | 1103 } |
| 1104 annotation.constant = constant; | 1104 annotation.constant = constant; |
| 1105 | 1105 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 TreeElements get treeElements { | 1140 TreeElements get treeElements { |
| 1141 assert(invariant(this, _treeElements != null, | 1141 assert(invariant(this, _treeElements != null, |
| 1142 message: "TreeElements have not been computed for $this.")); | 1142 message: "TreeElements have not been computed for $this.")); |
| 1143 return _treeElements; | 1143 return _treeElements; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 void reuseElement() { | 1146 void reuseElement() { |
| 1147 _treeElements = null; | 1147 _treeElements = null; |
| 1148 } | 1148 } |
| 1149 } | 1149 } |
| OLD | NEW |