Skip to content

Commit 96412df

Browse files
committed
ExprFunctionCall - fix return type of function not being used
1 parent d62d878 commit 96412df

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/main/java/io/github/syst3ms/skriptparser/structures/functions/ExprFunctionCall.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ public boolean init(Expression<?>[] expressions, int matchedPattern, ParseContex
110110
return true;
111111
}
112112

113+
@Override
114+
public Class<?> getReturnType() {
115+
Optional<Class<?>> returnType = (Optional<Class<?>>) this.function.getReturnType();
116+
if (returnType.isPresent()) return returnType.get();
117+
return Object.class;
118+
}
119+
113120
@Override
114121
public String toString(TriggerContext ctx, boolean debug) {
115122
return function.getName() + "(" + (parsedExpr != null ? parsedExpr.toString(ctx, debug) : "") + ")";

0 commit comments

Comments
 (0)