Skip to content

Commit

Permalink
fix: Use wildcard type in CtUnaryOperator get/setOperand
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Aug 27, 2023
1 parent dae341a commit 38fc609
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/spoon/reflect/code/CtUnaryOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public interface CtUnaryOperator<T> extends CtExpression<T>, CtStatement {
* Gets the expression to which the operator is applied.
*/
@PropertyGetter(role = EXPRESSION)
CtExpression<T> getOperand();
CtExpression<?> getOperand();

/**
* Sets the expression to which the operator is applied.
*/
@PropertySetter(role = EXPRESSION)
<C extends CtUnaryOperator> C setOperand(CtExpression<T> expression);
<C extends CtUnaryOperator> C setOperand(CtExpression<?> expression);

/**
* Sets the kind of this operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public class CtUnaryOperatorImpl<T> extends CtExpressionImpl<T> implements CtUna
String label;

@MetamodelPropertyField(role = EXPRESSION)
CtExpression<T> operand;
CtExpression<?> operand;

@Override
public void accept(CtVisitor visitor) {
visitor.visitCtUnaryOperator(this);
}

@Override
public CtExpression<T> getOperand() {
public CtExpression<?> getOperand() {
return operand;
}

Expand Down Expand Up @@ -76,7 +76,7 @@ public <C extends CtStatement> C insertBefore(CtStatementList statements) {
}

@Override
public <C extends CtUnaryOperator> C setOperand(CtExpression<T> expression) {
public <C extends CtUnaryOperator> C setOperand(CtExpression<?> expression) {
if (expression != null) {
expression.setParent(this);
}
Expand Down

0 comments on commit 38fc609

Please sign in to comment.