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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10984081: First step toward fixing cascades (issue 5062) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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: compiler/java/com/google/dart/compiler/resolver/Resolver.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/Resolver.java (revision 12980)
+++ compiler/java/com/google/dart/compiler/resolver/Resolver.java (working copy)
@@ -696,7 +696,7 @@
{
DartTypeNode rcTypeName = node.getRedirectedTypeName();
if (rcTypeName != null) {
- InterfaceType rcType = (InterfaceType) resolveType(rcTypeName, true, true, false,
+ Type rcType = resolveType(rcTypeName, true, true, false,
TypeErrorCode.NO_SUCH_TYPE, ResolverErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS);
switch (TypeKind.of(rcType)) {
case INTERFACE:
@@ -1323,7 +1323,7 @@
@Override
public Element visitPropertyAccess(DartPropertyAccess x) {
- Element qualifier = resolveQualifier(x.getQualifier());
+ Element qualifier = resolveQualifier(x.getRealTarget());
Element element = null;
switch (ElementKind.of(qualifier)) {
case CLASS:
@@ -1434,11 +1434,11 @@
case NONE: {
// TODO(zundel): This is a bit awkward. Maybe it would be better to have an
// ElementKind of THIS just like we have for SUPER?
- if (x.getQualifier() instanceof DartThisExpression) {
+ if (x.getRealTarget() instanceof DartThisExpression) {
Element foundElement = Elements.findElement(currentHolder, x.getPropertyName());
if (foundElement != null && !foundElement.getModifiers().isStatic()) {
if (ElementKind.of(foundElement) == ElementKind.TYPE_VARIABLE) {
- onError(x.getQualifier(), ResolverErrorCode.TYPE_VARIABLE_NOT_ALLOWED_IN_IDENTIFIER);
+ onError(x.getRealTarget(), ResolverErrorCode.TYPE_VARIABLE_NOT_ALLOWED_IN_IDENTIFIER);
break;
}
element = foundElement;
@@ -1486,7 +1486,7 @@
@Override
public Element visitMethodInvocation(DartMethodInvocation x) {
DartIdentifier name = x.getFunctionName();
- Element target = resolveQualifier(x.getTarget());
+ Element target = resolveQualifier(x.getRealTarget());
Element element = null;
switch (ElementKind.of(target)) {
@@ -1586,7 +1586,9 @@
@Override
public Element visitFunctionObjectInvocation(DartFunctionObjectInvocation x) {
- x.getTarget().accept(this);
+ if (!x.isCascade()) {
+ x.getTarget().accept(this);
+ }
visit(x.getArguments());
return null;
}

Powered by Google App Engine
This is Rietveld 408576698