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

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

Issue 2809603002: Introduce ParameterStructure (Closed)
Patch Set: Fix. Created 3 years, 8 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.constructors; 5 library dart2js.resolution.constructors;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../constants/constructors.dart' 9 import '../constants/constructors.dart'
10 show 10 show
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 result = reportAndCreateErroneousConstructor(node, constructorName, kind, 268 result = reportAndCreateErroneousConstructor(node, constructorName, kind,
269 {'constructorName': fullConstructorName}); 269 {'constructorName': fullConstructorName});
270 } else if (!lookedupConstructor.isGenerativeConstructor) { 270 } else if (!lookedupConstructor.isGenerativeConstructor) {
271 MessageKind kind = isThisCall 271 MessageKind kind = isThisCall
272 ? MessageKind.THIS_CALL_TO_FACTORY 272 ? MessageKind.THIS_CALL_TO_FACTORY
273 : MessageKind.SUPER_CALL_TO_FACTORY; 273 : MessageKind.SUPER_CALL_TO_FACTORY;
274 result = 274 result =
275 reportAndCreateErroneousConstructor(node, constructorName, kind, {}); 275 reportAndCreateErroneousConstructor(node, constructorName, kind, {});
276 } else { 276 } else {
277 lookedupConstructor.computeType(visitor.resolution); 277 lookedupConstructor.computeType(visitor.resolution);
278 if (!callStructure.signatureApplies(lookedupConstructor.type)) { 278 if (!callStructure
279 .signatureApplies(lookedupConstructor.parameterStructure)) {
279 MessageKind kind = isImplicitSuperCall 280 MessageKind kind = isImplicitSuperCall
280 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT 281 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
281 : MessageKind.NO_MATCHING_CONSTRUCTOR; 282 : MessageKind.NO_MATCHING_CONSTRUCTOR;
282 result = reportAndCreateErroneousConstructor( 283 result = reportAndCreateErroneousConstructor(
283 node, constructorName, kind, {}); 284 node, constructorName, kind, {});
284 } else if (constructor.isConst && !lookedupConstructor.isConst) { 285 } else if (constructor.isConst && !lookedupConstructor.isConst) {
285 MessageKind kind = isImplicitSuperCall 286 MessageKind kind = isImplicitSuperCall
286 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT 287 ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT
287 : MessageKind.CONST_CALLS_NON_CONST; 288 : MessageKind.CONST_CALLS_NON_CONST;
288 result = reportAndCreateErroneousConstructor( 289 result = reportAndCreateErroneousConstructor(
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 // constructors. 885 // constructors.
885 return null; 886 return null;
886 } 887 }
887 // TODO(johnniwinther): Use [Name] for lookup. 888 // TODO(johnniwinther): Use [Name] for lookup.
888 ConstructorElement constructor = cls.lookupConstructor(constructorName); 889 ConstructorElement constructor = cls.lookupConstructor(constructorName);
889 if (constructor != null) { 890 if (constructor != null) {
890 constructor = constructor.declaration; 891 constructor = constructor.declaration;
891 } 892 }
892 return constructor; 893 return constructor;
893 } 894 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698