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

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 812523002: Change signature of lookupConstructor to only require a name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fail gracefully on missing default constructors when evaluating constant constructors. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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 80d5b8246f3ac8f2960db028144e5d6f197d1b5b..33e7b0f1225d13a6099fe9dbaead6bc56791ac99 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1459,7 +1459,7 @@ class InitializerResolver {
Selector constructorSelector =
visitor.getRedirectingThisOrSuperConstructorSelector(call);
FunctionElement calledConstructor =
- lookupTarget.lookupConstructor(constructorSelector);
+ lookupTarget.lookupConstructor(constructorSelector.name);
final bool isImplicitSuperCall = false;
final String className = lookupTarget.name;
@@ -1497,7 +1497,7 @@ class InitializerResolver {
Selector constructorSelector = new Selector.callDefaultConstructor(
visitor.enclosingElement.library);
Element calledConstructor = lookupTarget.lookupConstructor(
- constructorSelector);
+ constructorSelector.name);
final String className = lookupTarget.name;
final bool isImplicitSuperCall = true;
@@ -2314,7 +2314,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
Selector selector =
getRedirectingThisOrSuperConstructorSelector(initializers.head);
final ClassElement classElement = constructor.enclosingClass;
- return classElement.lookupConstructor(selector);
+ return classElement.lookupConstructor(selector.name);
}
return null;
}
@@ -4786,8 +4786,7 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
Node diagnosticNode,
String constructorName) {
cls.ensureResolved(compiler);
- Selector selector = createConstructorSelector(constructorName);
- Element result = cls.lookupConstructor(selector);
+ Element result = cls.lookupConstructor(constructorName);
if (result == null) {
String fullConstructorName = Elements.constructorNameForDiagnostics(
cls.name,

Powered by Google App Engine
This is Rietveld 408576698