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

Unified Diff: pkg/compiler/lib/src/resolution/members.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index b87f9900406eb1d1d71f97222735a4f7d1e60444..090a076ef2dbc0f9ef3ae9437bbf0a6ce5e90479 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -409,13 +409,12 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
bool isNamedConstructor(Send node) => node.receiver != null;
- Selector getRedirectingThisOrSuperConstructorSelector(Send node) {
+ Name getRedirectingThisOrSuperConstructorName(Send node) {
if (isNamedConstructor(node)) {
String constructorName = node.selector.asIdentifier().source;
- return new Selector.callConstructor(
- new Name(constructorName, enclosingElement.library));
+ return new Name(constructorName, enclosingElement.library);
} else {
- return new Selector.callDefaultConstructor();
+ return const PublicName('');
}
}
@@ -428,10 +427,10 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
Link<Node> initializers = node.initializers.nodes;
if (!initializers.isEmpty &&
Initializers.isConstructorRedirect(initializers.head)) {
- Selector selector =
- getRedirectingThisOrSuperConstructorSelector(initializers.head);
+ Name name =
+ getRedirectingThisOrSuperConstructorName(initializers.head);
final ClassElement classElement = constructor.enclosingClass;
- return classElement.lookupConstructor(selector.name);
+ return classElement.lookupConstructor(name.text);
}
return null;
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698