| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3287 } | 3287 } |
| 3288 | 3288 |
| 3289 InterfaceType type = registry.getType(node); | 3289 InterfaceType type = registry.getType(node); |
| 3290 if (node.isConst && type.containsTypeVariables) { | 3290 if (node.isConst && type.containsTypeVariables) { |
| 3291 compiler.reportError(node.send.selector, | 3291 compiler.reportError(node.send.selector, |
| 3292 MessageKind.TYPE_VARIABLE_IN_CONSTANT); | 3292 MessageKind.TYPE_VARIABLE_IN_CONSTANT); |
| 3293 } | 3293 } |
| 3294 // TODO(johniwinther): Avoid registration of `type` in face of redirecting | 3294 // TODO(johniwinther): Avoid registration of `type` in face of redirecting |
| 3295 // factory constructors. | 3295 // factory constructors. |
| 3296 registry.registerInstantiatedType(type); | 3296 registry.registerInstantiatedType(type); |
| 3297 if (constructor.isFactoryConstructor && !type.typeArguments.isEmpty) { | |
| 3298 registry.registerFactoryWithTypeArguments(); | |
| 3299 } | |
| 3300 if (constructor.isGenerativeConstructor && cls.isAbstract) { | 3297 if (constructor.isGenerativeConstructor && cls.isAbstract) { |
| 3301 warning(node, MessageKind.ABSTRACT_CLASS_INSTANTIATION); | 3298 warning(node, MessageKind.ABSTRACT_CLASS_INSTANTIATION); |
| 3302 registry.registerAbstractClassInstantiation(); | 3299 registry.registerAbstractClassInstantiation(); |
| 3303 } | 3300 } |
| 3304 | 3301 |
| 3305 if (isSymbolConstructor) { | 3302 if (isSymbolConstructor) { |
| 3306 if (node.isConst) { | 3303 if (node.isConst) { |
| 3307 Node argumentNode = node.send.arguments.head; | 3304 Node argumentNode = node.send.arguments.head; |
| 3308 ConstantExpression constant = | 3305 ConstantExpression constant = |
| 3309 compiler.resolver.constantCompiler.compileNode( | 3306 compiler.resolver.constantCompiler.compileNode( |
| (...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5032 } | 5029 } |
| 5033 | 5030 |
| 5034 /// The result for the resolution of the `assert` method. | 5031 /// The result for the resolution of the `assert` method. |
| 5035 class AssertResult implements ResolutionResult { | 5032 class AssertResult implements ResolutionResult { |
| 5036 const AssertResult(); | 5033 const AssertResult(); |
| 5037 | 5034 |
| 5038 Element get element => null; | 5035 Element get element => null; |
| 5039 | 5036 |
| 5040 String toString() => 'AssertResult()'; | 5037 String toString() => 'AssertResult()'; |
| 5041 } | 5038 } |
| OLD | NEW |