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

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

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle (bypass) external const constructors. Created 5 years, 5 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 part of resolution; 5 part of resolution;
6 6
7 class InitializerResolver { 7 class InitializerResolver {
8 final ResolverVisitor visitor; 8 final ResolverVisitor visitor;
9 final ConstructorElementX constructor; 9 final ConstructorElementX constructor;
10 final FunctionExpression functionNode; 10 final FunctionExpression functionNode;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 String fullConstructorName = Elements.constructorNameForDiagnostics( 214 String fullConstructorName = Elements.constructorNameForDiagnostics(
215 className, 215 className,
216 constructorSelector.name); 216 constructorSelector.name);
217 MessageKind kind = isImplicitSuperCall 217 MessageKind kind = isImplicitSuperCall
218 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT 218 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT
219 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; 219 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR;
220 visitor.compiler.reportError( 220 visitor.compiler.reportError(
221 diagnosticNode, kind, {'constructorName': fullConstructorName}); 221 diagnosticNode, kind, {'constructorName': fullConstructorName});
222 isValidAsConstant = false; 222 isValidAsConstant = false;
223 } else { 223 } else {
224 lookedupConstructor.computeSignature(visitor.compiler); 224 lookedupConstructor.computeType(visitor.compiler);
225 if (!call.signatureApplies(lookedupConstructor.functionSignature)) { 225 if (!call.signatureApplies(lookedupConstructor.functionSignature)) {
226 MessageKind kind = isImplicitSuperCall 226 MessageKind kind = isImplicitSuperCall
227 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT 227 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
228 : MessageKind.NO_MATCHING_CONSTRUCTOR; 228 : MessageKind.NO_MATCHING_CONSTRUCTOR;
229 visitor.compiler.reportError(diagnosticNode, kind); 229 visitor.compiler.reportError(diagnosticNode, kind);
230 isValidAsConstant = false; 230 isValidAsConstant = false;
231 } else if (constructor.isConst 231 } else if (constructor.isConst
232 && !lookedupConstructor.isConst) { 232 && !lookedupConstructor.isConst) {
233 MessageKind kind = isImplicitSuperCall 233 MessageKind kind = isImplicitSuperCall
234 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT 234 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 return element; 572 return element;
573 } 573 }
574 574
575 /// Assumed to be called by [resolveRedirectingFactory]. 575 /// Assumed to be called by [resolveRedirectingFactory].
576 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { 576 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) {
577 Node constructorReference = node.constructorReference; 577 Node constructorReference = node.constructorReference;
578 return finishConstructorReference(visit(constructorReference), 578 return finishConstructorReference(visit(constructorReference),
579 constructorReference, node); 579 constructorReference, node);
580 } 580 }
581 } 581 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/enum_creator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698