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

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

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/ssa/builder.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.semantics_visitor.resolver; 5 library dart2js.semantics_visitor.resolver;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 18 matching lines...) Expand all
29 CallStructure callStructure, 29 CallStructure callStructure,
30 DartType type, 30 DartType type,
31 {bool mustBeConstant: false}) { 31 {bool mustBeConstant: false}) {
32 if (mustBeConstant && !constructor.isConst) { 32 if (mustBeConstant && !constructor.isConst) {
33 return new ConstructorAccessSemantics( 33 return new ConstructorAccessSemantics(
34 ConstructorAccessKind.NON_CONSTANT_CONSTRUCTOR, constructor, type); 34 ConstructorAccessKind.NON_CONSTANT_CONSTRUCTOR, constructor, type);
35 } 35 }
36 if (constructor.isMalformed) { 36 if (constructor.isMalformed) {
37 if (constructor is ErroneousElement) { 37 if (constructor is ErroneousElement) {
38 ErroneousElement error = constructor; 38 ErroneousElement error = constructor;
39 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { 39 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR ||
40 error.messageKind == MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR) {
40 return new ConstructorAccessSemantics( 41 return new ConstructorAccessSemantics(
41 ConstructorAccessKind.UNRESOLVED_CONSTRUCTOR, constructor, type); 42 ConstructorAccessKind.UNRESOLVED_CONSTRUCTOR, constructor, type);
42 } 43 }
43 } 44 }
44 return new ConstructorAccessSemantics( 45 return new ConstructorAccessSemantics(
45 ConstructorAccessKind.UNRESOLVED_TYPE, constructor, type); 46 ConstructorAccessKind.UNRESOLVED_TYPE, constructor, type);
46 } else if (constructor.isRedirectingFactory) { 47 } else if (constructor.isRedirectingFactory) {
47 ConstructorElement effectiveTarget = constructor.effectiveTarget; 48 ConstructorElement effectiveTarget = constructor.effectiveTarget;
48 if (effectiveTarget == constructor || 49 if (effectiveTarget == constructor ||
49 effectiveTarget.isMalformed || 50 effectiveTarget.isMalformed ||
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 return internalError(node, "Unexpected variable $element."); 469 return internalError(node, "Unexpected variable $element.");
469 } 470 }
470 if (element.isConst) { 471 if (element.isConst) {
471 ConstantExpression constant = elements.getConstant(element.initializer); 472 ConstantExpression constant = elements.getConstant(element.initializer);
472 return new ConstantVariableStructure(kind, node, element, constant); 473 return new ConstantVariableStructure(kind, node, element, constant);
473 } else { 474 } else {
474 return new NonConstantVariableStructure(kind, node, element); 475 return new NonConstantVariableStructure(kind, node, element);
475 } 476 }
476 } 477 }
477 } 478 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698