Skip to content

Commit

Permalink
Fix EffReturn error message (#6983)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderscoreTud authored Aug 20, 2024
1 parent d78bf61 commit 56119b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/ch/njol/skript/effects/EffReturn.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
}

if (handler.isSingleReturnValue() && !convertedExpr.isSingle()) {
Skript.error(handler + " is defined to only return a single " + returnType + ", but this return statement can return multiple values.");
String typeName = Classes.getSuperClassInfo(returnType).getName().getSingular();
Skript.error(handler + " is defined to only return a single " + typeName + ", but this return statement can return multiple values.");
return false;
}
value = convertedExpr;
Expand Down

0 comments on commit 56119b3

Please sign in to comment.