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

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

Issue 11360104: Fix bad type annotation to unbreak host-checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 2939 matching lines...) Expand 10 before | Expand all | Expand 10 after
2950 inConstContext = node.isConst(); 2950 inConstContext = node.isConst();
2951 Node selector = node.send.selector; 2951 Node selector = node.send.selector;
2952 Element e = visit(selector); 2952 Element e = visit(selector);
2953 return finishConstructorReference(e, node.send.selector, node); 2953 return finishConstructorReference(e, node.send.selector, node);
2954 } 2954 }
2955 2955
2956 /// Finishes resolution of a constructor reference and records the 2956 /// Finishes resolution of a constructor reference and records the
2957 /// type of the constructed instance on [expression]. 2957 /// type of the constructed instance on [expression].
2958 FunctionElement finishConstructorReference(Element e, 2958 FunctionElement finishConstructorReference(Element e,
2959 Node diagnosticNode, 2959 Node diagnosticNode,
2960 Expression expression) { 2960 Node expression) {
2961 // Find the unnamed constructor if the reference resolved to a 2961 // Find the unnamed constructor if the reference resolved to a
2962 // class. 2962 // class.
2963 if (!Elements.isUnresolved(e) && e.isClass()) { 2963 if (!Elements.isUnresolved(e) && e.isClass()) {
2964 ClassElement cls = e; 2964 ClassElement cls = e;
2965 cls.ensureResolved(compiler); 2965 cls.ensureResolved(compiler);
2966 if (cls.isInterface() && (cls.defaultClass == null)) { 2966 if (cls.isInterface() && (cls.defaultClass == null)) {
2967 // TODO(ahe): Remove this check and error message when we 2967 // TODO(ahe): Remove this check and error message when we
2968 // don't have interfaces anymore. 2968 // don't have interfaces anymore.
2969 error(diagnosticNode, 2969 error(diagnosticNode,
2970 MessageKind.CANNOT_INSTANTIATE_INTERFACE, [cls.name]); 2970 MessageKind.CANNOT_INSTANTIATE_INTERFACE, [cls.name]);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
3033 error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE, [name]); 3033 error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE, [name]);
3034 } else if (!identical(e.kind, ElementKind.CLASS) 3034 } else if (!identical(e.kind, ElementKind.CLASS)
3035 && !identical(e.kind, ElementKind.PREFIX)) { 3035 && !identical(e.kind, ElementKind.PREFIX)) {
3036 error(node, MessageKind.NOT_A_TYPE, [name]); 3036 error(node, MessageKind.NOT_A_TYPE, [name]);
3037 } 3037 }
3038 return e; 3038 return e;
3039 } 3039 }
3040 3040
3041 /// Assumed to be called by [resolveRedirectingFactory]. 3041 /// Assumed to be called by [resolveRedirectingFactory].
3042 Element visitReturn(Return node) { 3042 Element visitReturn(Return node) {
3043 Expression expression = node.expression; 3043 Node expression = node.expression;
3044 return finishConstructorReference(visit(expression), 3044 return finishConstructorReference(visit(expression),
3045 expression, expression); 3045 expression, expression);
3046 } 3046 }
3047 } 3047 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698