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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 111283006: Revert "Compute correct constructor type for synthesized mixin constructors." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
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 Element get currentElement; 8 Element get currentElement;
9 Setlet<Node> get superUses; 9 Setlet<Node> get superUses;
10 10
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 while (!seen.isEmpty) { 638 while (!seen.isEmpty) {
639 FunctionElementX factory = seen.removeLast(); 639 FunctionElementX factory = seen.removeLast();
640 640
641 TreeElements treeElements = 641 TreeElements treeElements =
642 compiler.enqueuer.resolution.getCachedElements(factory); 642 compiler.enqueuer.resolution.getCachedElements(factory);
643 FunctionExpression functionNode = factory.parseNode(compiler); 643 FunctionExpression functionNode = factory.parseNode(compiler);
644 Return redirectionNode = functionNode.body; 644 Return redirectionNode = functionNode.body;
645 InterfaceType factoryType = 645 InterfaceType factoryType =
646 treeElements.getType(redirectionNode.expression); 646 treeElements.getType(redirectionNode.expression);
647 647
648 targetType = targetType.substByContext(factoryType); 648 targetType = targetType.subst(factoryType.typeArguments,
649 factoryType.element.typeVariables);
649 factory.redirectionTarget = target; 650 factory.redirectionTarget = target;
650 factory.redirectionTargetType = targetType; 651 factory.redirectionTargetType = targetType;
651 } 652 }
652 } 653 }
653 654
654 /** 655 /**
655 * Load and resolve the supertypes of [cls]. 656 * Load and resolve the supertypes of [cls].
656 * 657 *
657 * Warning: do not call this method directly. It should only be 658 * Warning: do not call this method directly. It should only be
658 * called by [resolveClass] and [ClassSupertypeResolver]. 659 * called by [resolveClass] and [ClassSupertypeResolver].
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER); 2731 node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER);
2731 compiler.backend.registerThrowNoSuchMethod(mapping); 2732 compiler.backend.registerThrowNoSuchMethod(mapping);
2732 } 2733 }
2733 } else if (target.impliesType()) { 2734 } else if (target.impliesType()) {
2734 setter = warnAndCreateErroneousElement( 2735 setter = warnAndCreateErroneousElement(
2735 node.selector, target.name, MessageKind.ASSIGNING_TYPE); 2736 node.selector, target.name, MessageKind.ASSIGNING_TYPE);
2736 compiler.backend.registerThrowNoSuchMethod(mapping); 2737 compiler.backend.registerThrowNoSuchMethod(mapping);
2737 } else if (target.modifiers.isFinal() || 2738 } else if (target.modifiers.isFinal() ||
2738 target.modifiers.isConst() || 2739 target.modifiers.isConst() ||
2739 (target.isFunction() && 2740 (target.isFunction() &&
2740 Elements.isStaticOrTopLevelFunction(target) && 2741 Elements.isStaticOrTopLevelFunction(target) &&
2741 !target.isSetter())) { 2742 !target.isSetter())) {
2742 if (target.isFunction()) { 2743 if (target.isFunction()) {
2743 setter = warnAndCreateErroneousElement( 2744 setter = warnAndCreateErroneousElement(
2744 node.selector, target.name, MessageKind.ASSIGNING_METHOD); 2745 node.selector, target.name, MessageKind.ASSIGNING_METHOD);
2745 } else { 2746 } else {
2746 setter = warnAndCreateErroneousElement( 2747 setter = warnAndCreateErroneousElement(
2747 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER); 2748 node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER);
2748 } 2749 }
2749 compiler.backend.registerThrowNoSuchMethod(mapping); 2750 compiler.backend.registerThrowNoSuchMethod(mapping);
2750 } 2751 }
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
4158 new OrderedTypeSet.singleton(cls.computeType(compiler)); 4159 new OrderedTypeSet.singleton(cls.computeType(compiler));
4159 } 4160 }
4160 } 4161 }
4161 4162
4162 /** 4163 /**
4163 * Adds [type] and all supertypes of [type] to [allSupertypes] while 4164 * Adds [type] and all supertypes of [type] to [allSupertypes] while
4164 * substituting type variables. 4165 * substituting type variables.
4165 */ 4166 */
4166 void addAllSupertypes(OrderedTypeSetBuilder allSupertypes, 4167 void addAllSupertypes(OrderedTypeSetBuilder allSupertypes,
4167 InterfaceType type) { 4168 InterfaceType type) {
4169 Link<DartType> typeArguments = type.typeArguments;
4168 ClassElement classElement = type.element; 4170 ClassElement classElement = type.element;
4171 Link<DartType> typeVariables = classElement.typeVariables;
4169 Link<DartType> supertypes = classElement.allSupertypes; 4172 Link<DartType> supertypes = classElement.allSupertypes;
4170 assert(invariant(element, supertypes != null, 4173 assert(invariant(element, supertypes != null,
4171 message: "Supertypes not computed on $classElement " 4174 message: "Supertypes not computed on $classElement "
4172 "during resolution of $element")); 4175 "during resolution of $element"));
4173 while (!supertypes.isEmpty) { 4176 while (!supertypes.isEmpty) {
4174 DartType supertype = supertypes.head; 4177 DartType supertype = supertypes.head;
4175 allSupertypes.add(compiler, supertype.substByContext(type)); 4178 allSupertypes.add(compiler,
4179 supertype.subst(typeArguments, typeVariables));
4176 supertypes = supertypes.tail; 4180 supertypes = supertypes.tail;
4177 } 4181 }
4178 } 4182 }
4179 4183
4180 isBlackListed(DartType type) { 4184 isBlackListed(DartType type) {
4181 LibraryElement lib = element.getLibrary(); 4185 LibraryElement lib = element.getLibrary();
4182 return 4186 return
4183 !identical(lib, compiler.coreLibrary) && 4187 !identical(lib, compiler.coreLibrary) &&
4184 !identical(lib, compiler.jsHelperLibrary) && 4188 !identical(lib, compiler.jsHelperLibrary) &&
4185 !identical(lib, compiler.interceptorsLibrary) && 4189 !identical(lib, compiler.interceptorsLibrary) &&
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
4766 return finishConstructorReference(visit(expression), 4770 return finishConstructorReference(visit(expression),
4767 expression, expression); 4771 expression, expression);
4768 } 4772 }
4769 } 4773 }
4770 4774
4771 /// Looks up [name] in [scope] and unwraps the result. 4775 /// Looks up [name] in [scope] and unwraps the result.
4772 Element lookupInScope(Compiler compiler, Node node, 4776 Element lookupInScope(Compiler compiler, Node node,
4773 Scope scope, String name) { 4777 Scope scope, String name) {
4774 return Elements.unwrap(scope.lookup(name), compiler, node); 4778 return Elements.unwrap(scope.lookup(name), compiler, node);
4775 } 4779 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698