Skip to content

Commit

Permalink
Use getSelfType for qualified literal this. Fixes #2208
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Nov 15, 2018
1 parent 623168e commit 80c20b3
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedArrayType;
Expand Down Expand Up @@ -152,9 +151,8 @@ public AnnotatedTypeMirror visitMemberSelect(MemberSelectTree node, AnnotatedTyp
}

if (node.getIdentifier().contentEquals("this")) {
// TODO: why don't we use getSelfType here?
return f.getEnclosingType(
(TypeElement) TreeUtils.elementFromTree(node.getExpression()), node);
AnnotatedDeclaredType res = f.getSelfType(node.getExpression());
return res;
} else {
// node must be a field access, so get the type of the expression, and then call
// asMemberOf.
Expand Down

0 comments on commit 80c20b3

Please sign in to comment.