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

Unified Diff: sdk/lib/_internal/compiler/implementation/typechecker.dart

Issue 98533005: Handle @proxy classes in type checker. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years 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: sdk/lib/_internal/compiler/implementation/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index a14859b56f48118f3390b6fe2e8708a4c28c0e60..e492ca5cc30b1b1d9c6576d8f0b902fee8efdb22 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -623,7 +623,7 @@ class TypeCheckerVisitor extends Visitor<DartType> {
if (receiverType.treatAsDynamic) {
return const DynamicAccess();
}
- Member getMember(DartType type) {
+ InterfaceType computeInterfaceType(DartType type) {
DartType originalType = type;
while (identical(type.kind, TypeKind.TYPE_VARIABLE)) {
TypeVariableType variable = type;
@@ -639,7 +639,10 @@ class TypeCheckerVisitor extends Visitor<DartType> {
}
assert(invariant(node, type.kind == TypeKind.INTERFACE,
message: "unexpected type kind ${type.kind}."));
- InterfaceType interface = type;
+ return type;
+ }
+ Member getMember(DartType type) {
+ InterfaceType interface = computeInterfaceType(type);
return interface.lookupMember(name,
isSetter: identical(memberKind, MemberKind.SETTER));
}
@@ -663,23 +666,26 @@ class TypeCheckerVisitor extends Visitor<DartType> {
}
}
}
- switch (memberKind) {
- case MemberKind.METHOD:
- reportTypeWarning(node, MessageKind.METHOD_NOT_FOUND,
- {'className': receiverType.name, 'memberName': name});
- break;
- case MemberKind.OPERATOR:
- reportTypeWarning(node, MessageKind.OPERATOR_NOT_FOUND,
- {'className': receiverType.name, 'memberName': name});
- break;
- case MemberKind.GETTER:
- reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND.warning,
- {'className': receiverType.name, 'memberName': name});
- break;
- case MemberKind.SETTER:
- reportTypeWarning(node, MessageKind.PROPERTY_NOT_FOUND,
- {'className': receiverType.name, 'memberName': name});
- break;
+ InterfaceType interface = computeInterfaceType(receiverType);
+ if (!interface.element.isProxy) {
+ switch (memberKind) {
+ case MemberKind.METHOD:
+ reportTypeWarning(node, MessageKind.METHOD_NOT_FOUND,
+ {'className': receiverType.name, 'memberName': name});
+ break;
+ case MemberKind.OPERATOR:
+ reportTypeWarning(node, MessageKind.OPERATOR_NOT_FOUND,
+ {'className': receiverType.name, 'memberName': name});
+ break;
+ case MemberKind.GETTER:
+ reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND.warning,
+ {'className': receiverType.name, 'memberName': name});
+ break;
+ case MemberKind.SETTER:
+ reportTypeWarning(node, MessageKind.PROPERTY_NOT_FOUND,
+ {'className': receiverType.name, 'memberName': name});
+ break;
+ }
}
return const DynamicAccess();
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698