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

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

Issue 1969313007: Handle explicit constructor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/compilation_test.dart » ('j') | 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) 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 Feature; 8 import '../common/resolution.dart' show Feature;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constructors.dart' 10 import '../constants/constructors.dart'
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 kind, arguments, name, visitor.currentClass); 242 kind, arguments, name, visitor.currentClass);
243 } 243 }
244 244
245 /// Checks that [lookedupConstructor] is valid as a target for the super/this 245 /// Checks that [lookedupConstructor] is valid as a target for the super/this
246 /// constructor call using with the given [callStructure]. 246 /// constructor call using with the given [callStructure].
247 /// 247 ///
248 /// If [lookedupConstructor] is valid it is returned, otherwise an error is 248 /// If [lookedupConstructor] is valid it is returned, otherwise an error is
249 /// reported and an [ErroneousConstructorElement] is returned. 249 /// reported and an [ErroneousConstructorElement] is returned.
250 ConstructorElement verifyThatConstructorMatchesCall( 250 ConstructorElement verifyThatConstructorMatchesCall(
251 Node node, 251 Node node,
252 ConstructorElementX lookedupConstructor, 252 ConstructorElement lookedupConstructor,
Siggi Cherem (dart-lang) 2016/05/17 20:42:38 funny that all of the semantic changes are just 1
Johnni Winther 2016/05/18 10:17:21 Yes :)
253 CallStructure callStructure, 253 CallStructure callStructure,
254 String className, 254 String className,
255 {String constructorName: '', 255 {String constructorName: '',
256 bool isImplicitSuperCall: false, 256 bool isImplicitSuperCall: false,
257 bool isThisCall: false}) { 257 bool isThisCall: false}) {
258 Element result = lookedupConstructor; 258 Element result = lookedupConstructor;
259 if (lookedupConstructor == null) { 259 if (lookedupConstructor == null) {
260 String fullConstructorName = 260 String fullConstructorName =
261 Elements.constructorNameForDiagnostics(className, constructorName); 261 Elements.constructorNameForDiagnostics(className, constructorName);
262 MessageKind kind = isImplicitSuperCall 262 MessageKind kind = isImplicitSuperCall
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 // constructors. 849 // constructors.
850 return null; 850 return null;
851 } 851 }
852 // TODO(johnniwinther): Use [Name] for lookup. 852 // TODO(johnniwinther): Use [Name] for lookup.
853 ConstructorElement constructor = cls.lookupConstructor(constructorName); 853 ConstructorElement constructor = cls.lookupConstructor(constructorName);
854 if (constructor != null) { 854 if (constructor != null) {
855 constructor = constructor.declaration; 855 constructor = constructor.declaration;
856 } 856 }
857 return constructor; 857 return constructor;
858 } 858 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/compilation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698