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

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

Issue 1213833002: Use a FunctionSignature in CallStructure.signatureApplies (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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 Map<Element, Node> initialized; 9 final Map<Element, Node> initialized;
10 Link<Node> initializers; 10 Link<Node> initializers;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 void verifyThatConstructorMatchesCall( 166 void verifyThatConstructorMatchesCall(
167 FunctionElement caller, 167 FunctionElement caller,
168 ConstructorElementX lookedupConstructor, 168 ConstructorElementX lookedupConstructor,
169 CallStructure call, 169 CallStructure call,
170 bool isImplicitSuperCall, 170 bool isImplicitSuperCall,
171 Node diagnosticNode, 171 Node diagnosticNode,
172 String className, 172 String className,
173 Selector constructorSelector) { 173 Selector constructorSelector) {
174 if (lookedupConstructor == null 174 if (lookedupConstructor == null ||
175 || !lookedupConstructor.isGenerativeConstructor) { 175 !lookedupConstructor.isGenerativeConstructor) {
176 String fullConstructorName = Elements.constructorNameForDiagnostics( 176 String fullConstructorName = Elements.constructorNameForDiagnostics(
177 className, 177 className,
178 constructorSelector.name); 178 constructorSelector.name);
179 MessageKind kind = isImplicitSuperCall 179 MessageKind kind = isImplicitSuperCall
180 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT 180 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT
181 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; 181 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR;
182 visitor.compiler.reportError( 182 visitor.compiler.reportError(
183 diagnosticNode, kind, {'constructorName': fullConstructorName}); 183 diagnosticNode, kind, {'constructorName': fullConstructorName});
184 } else { 184 } else {
185 lookedupConstructor.computeSignature(visitor.compiler); 185 lookedupConstructor.computeSignature(visitor.compiler);
186 if (!call.signatureApplies(lookedupConstructor)) { 186 if (!call.signatureApplies(lookedupConstructor.functionSignature)) {
187 MessageKind kind = isImplicitSuperCall 187 MessageKind kind = isImplicitSuperCall
188 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT 188 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
189 : MessageKind.NO_MATCHING_CONSTRUCTOR; 189 : MessageKind.NO_MATCHING_CONSTRUCTOR;
190 visitor.compiler.reportError(diagnosticNode, kind); 190 visitor.compiler.reportError(diagnosticNode, kind);
191 } else if (caller.isConst 191 } else if (caller.isConst
192 && !lookedupConstructor.isConst) { 192 && !lookedupConstructor.isConst) {
193 MessageKind kind = isImplicitSuperCall 193 MessageKind kind = isImplicitSuperCall
194 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT 194 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT
195 : MessageKind.CONST_CALLS_NON_CONST; 195 : MessageKind.CONST_CALLS_NON_CONST;
196 visitor.compiler.reportError(diagnosticNode, kind); 196 visitor.compiler.reportError(diagnosticNode, kind);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 return element; 468 return element;
469 } 469 }
470 470
471 /// Assumed to be called by [resolveRedirectingFactory]. 471 /// Assumed to be called by [resolveRedirectingFactory].
472 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { 472 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) {
473 Node constructorReference = node.constructorReference; 473 Node constructorReference = node.constructorReference;
474 return finishConstructorReference(visit(constructorReference), 474 return finishConstructorReference(visit(constructorReference),
475 constructorReference, node); 475 constructorReference, node);
476 } 476 }
477 } 477 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698