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

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

Issue 1062913003: Extract CallStructure from Selector. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix expentancy in unittest Created 5 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 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 248f5a57eb0ef67aa5eb0340a6bf98d8ffb9b6fc..652387b9ab146828326a32ce5cdb473311b9a15c 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1500,7 +1500,7 @@ class InitializerResolver {
final String className = lookupTarget.name;
verifyThatConstructorMatchesCall(constructor,
calledConstructor,
- selector,
+ selector.callStructure,
isImplicitSuperCall,
call,
className,
@@ -1519,11 +1519,6 @@ class InitializerResolver {
if (classElement != visitor.compiler.objectClass) {
assert(superClass != null);
assert(superClass.resolutionState == STATE_DONE);
- String constructorName = '';
- Selector callToMatch = new Selector.call(
- constructorName,
- classElement.library,
- 0);
final bool isSuperCall = true;
ClassElement lookupTarget = getSuperOrThisLookupTarget(constructor,
@@ -1537,7 +1532,7 @@ class InitializerResolver {
final bool isImplicitSuperCall = true;
verifyThatConstructorMatchesCall(constructor,
calledConstructor,
- callToMatch,
+ CallStructure.NO_ARGS,
isImplicitSuperCall,
functionNode,
className,
@@ -1550,7 +1545,7 @@ class InitializerResolver {
void verifyThatConstructorMatchesCall(
FunctionElement caller,
ConstructorElementX lookedupConstructor,
- Selector call,
+ CallStructure call,
bool isImplicitSuperCall,
Node diagnosticNode,
String className,
@@ -1567,7 +1562,7 @@ class InitializerResolver {
diagnosticNode, kind, {'constructorName': fullConstructorName});
} else {
lookedupConstructor.computeSignature(visitor.compiler);
- if (!call.applies(lookedupConstructor, visitor.compiler.world)) {
+ if (!call.signatureApplies(lookedupConstructor)) {
MessageKind kind = isImplicitSuperCall
? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
: MessageKind.NO_MATCHING_CONSTRUCTOR;
@@ -4859,6 +4854,11 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
String constructorName) {
cls.ensureResolved(compiler);
Element result = cls.lookupConstructor(constructorName);
+ // TODO(johnniwinther): Use [Name] for lookup.
+ if (isPrivateName(constructorName) &&
+ resolver.enclosingElement.library != cls.library) {
+ result = null;
+ }
if (result == null) {
String fullConstructorName = Elements.constructorNameForDiagnostics(
cls.name,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698