Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: pkg/compiler/lib/src/resolution/class_hierarchy.dart

Issue 2017903002: Improve equivalence testing of unnamed mixin applications. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 doApplyMixinTo(element, supertype, checkMixinType(link.head)); 298 doApplyMixinTo(element, supertype, checkMixinType(link.head));
299 return element.computeType(resolution); 299 return element.computeType(resolution);
300 } 300 }
301 301
302 DartType applyMixin(DartType supertype, DartType mixinType, Node node) { 302 DartType applyMixin(DartType supertype, DartType mixinType, Node node) {
303 String superName = supertype.name; 303 String superName = supertype.name;
304 String mixinName = mixinType.name; 304 String mixinName = mixinType.name;
305 MixinApplicationElementX mixinApplication = 305 MixinApplicationElementX mixinApplication =
306 new UnnamedMixinApplicationElementX( 306 new UnnamedMixinApplicationElementX(
307 "${superName}+${mixinName}", 307 "${superName}+${mixinName}",
308 element.compilationUnit, 308 element,
Siggi Cherem (dart-lang) 2016/05/31 21:37:11 oh wow, and it used to work?
Johnni Winther 2016/06/02 08:19:39 We only use this for the enclosingElement.
309 compiler.idGenerator.getNextFreeId(), 309 compiler.idGenerator.getNextFreeId(),
310 node); 310 node);
311 // Create synthetic type variables for the mixin application. 311 // Create synthetic type variables for the mixin application.
312 List<DartType> typeVariables = <DartType>[]; 312 List<DartType> typeVariables = <DartType>[];
313 int index = 0; 313 int index = 0;
314 for (TypeVariableType type in element.typeVariables) { 314 for (TypeVariableType type in element.typeVariables) {
315 TypeVariableElementX typeVariableElement = new TypeVariableElementX( 315 TypeVariableElementX typeVariableElement = new TypeVariableElementX(
316 type.name, mixinApplication, index, type.element.node); 316 type.name, mixinApplication, index, type.element.node);
317 TypeVariableType typeVariable = new TypeVariableType(typeVariableElement); 317 TypeVariableType typeVariable = new TypeVariableType(typeVariableElement);
318 typeVariables.add(typeVariable); 318 typeVariables.add(typeVariable);
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 Identifier selector = node.selector.asIdentifier(); 648 Identifier selector = node.selector.asIdentifier();
649 var e = prefixElement.lookupLocalMember(selector.source); 649 var e = prefixElement.lookupLocalMember(selector.source);
650 if (e == null || !e.impliesType) { 650 if (e == null || !e.impliesType) {
651 reporter.reportErrorMessage(node.selector, 651 reporter.reportErrorMessage(node.selector,
652 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); 652 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector});
653 return; 653 return;
654 } 654 }
655 loadSupertype(e, node); 655 loadSupertype(e, node);
656 } 656 }
657 } 657 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698