| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.class_hierarchy; | 5 library dart2js.resolution.class_hierarchy; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Feature; | 8 import '../common/resolution.dart' show Feature; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../core_types.dart' show CoreClasses, CoreTypes; | 10 import '../core_types.dart' show CoreClasses, CoreTypes; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 doApplyMixinTo(element, supertype, checkMixinType(link.head)); | 294 doApplyMixinTo(element, supertype, checkMixinType(link.head)); |
| 295 return element.computeType(resolution); | 295 return element.computeType(resolution); |
| 296 } | 296 } |
| 297 | 297 |
| 298 DartType applyMixin(DartType supertype, DartType mixinType, Node node) { | 298 DartType applyMixin(DartType supertype, DartType mixinType, Node node) { |
| 299 String superName = supertype.name; | 299 String superName = supertype.name; |
| 300 String mixinName = mixinType.name; | 300 String mixinName = mixinType.name; |
| 301 MixinApplicationElementX mixinApplication = | 301 MixinApplicationElementX mixinApplication = |
| 302 new UnnamedMixinApplicationElementX("${superName}+${mixinName}", | 302 new UnnamedMixinApplicationElementX("${superName}+${mixinName}", |
| 303 element.compilationUnit, compiler.getNextFreeClassId(), node); | 303 element.compilationUnit, compiler.getNextFreeId(), node); |
| 304 // Create synthetic type variables for the mixin application. | 304 // Create synthetic type variables for the mixin application. |
| 305 List<DartType> typeVariables = <DartType>[]; | 305 List<DartType> typeVariables = <DartType>[]; |
| 306 int index = 0; | 306 int index = 0; |
| 307 for (TypeVariableType type in element.typeVariables) { | 307 for (TypeVariableType type in element.typeVariables) { |
| 308 TypeVariableElementX typeVariableElement = new TypeVariableElementX( | 308 TypeVariableElementX typeVariableElement = new TypeVariableElementX( |
| 309 type.name, mixinApplication, index, type.element.node); | 309 type.name, mixinApplication, index, type.element.node); |
| 310 TypeVariableType typeVariable = new TypeVariableType(typeVariableElement); | 310 TypeVariableType typeVariable = new TypeVariableType(typeVariableElement); |
| 311 typeVariables.add(typeVariable); | 311 typeVariables.add(typeVariable); |
| 312 index++; | 312 index++; |
| 313 } | 313 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 Identifier selector = node.selector.asIdentifier(); | 642 Identifier selector = node.selector.asIdentifier(); |
| 643 var e = prefixElement.lookupLocalMember(selector.source); | 643 var e = prefixElement.lookupLocalMember(selector.source); |
| 644 if (e == null || !e.impliesType) { | 644 if (e == null || !e.impliesType) { |
| 645 reporter.reportErrorMessage(node.selector, | 645 reporter.reportErrorMessage(node.selector, |
| 646 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 646 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
| 647 return; | 647 return; |
| 648 } | 648 } |
| 649 loadSupertype(e, node); | 649 loadSupertype(e, node); |
| 650 } | 650 } |
| 651 } | 651 } |
| OLD | NEW |