Skip to content

Commit

Permalink
fix(type): Fixes the getType method of CtVariableAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
danglotb committed Mar 3, 2016
1 parent 8428851 commit bf98b41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import spoon.reflect.code.CtTargetedExpression;
import spoon.reflect.code.CtVariableAccess;
import spoon.reflect.reference.CtFieldReference;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.reference.CtVariableReference;

public abstract class CtFieldAccessImpl<T> extends CtVariableReadImpl<T> implements CtFieldAccess<T> {
Expand Down Expand Up @@ -52,4 +53,9 @@ public CtFieldReference<T> getVariable() {
public <C extends CtVariableAccess<T>> C setVariable(CtVariableReference<T> variable) {
return super.setVariable(variable);
}

@Override
public CtTypeReference<T> getType() {
return getVariable() == null ? null : getVariable().getType();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package spoon.support.reflect.code;

import spoon.reflect.code.CtVariableAccess;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.reference.CtVariableReference;

public abstract class CtVariableAccessImpl<T> extends CtExpressionImpl<T> implements CtVariableAccess<T> {
Expand Down

0 comments on commit bf98b41

Please # to comment.