-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.ClassCastException: ch.njol.skript.util.Timespan cannot be cast to ch.njol.skript.util.Date #1001
Comments
This is a recent issue, it used to be a silent failure. The issue with your script, though, is that you can't compare a date and a timespan (think about it, it wouldn't make sense.. How do you compare |
Well, silent failures are bad but this is worse. |
Marking as an enhancement since this isn't a bug (it's user error, the things you're comparing can't be compared) but there should be an on-parse error which says you can't get the difference between a date and timespan. |
That isnt really possible |
Why not? Couldn't it just check if the things you're checking a difference between are a timespan and a date? |
It isn't possible because sometimes the thing being returned isn't known until runtime. Take variables for example, unless you meant if it could be determined in which case it already does error although not descriptively. |
Similar #575 Also use |
java.lang.ClassCastException: ch.njol.skript.util.Timespan cannot be cast to ch.njol.skript.util.Date
My skript is most likely broken, but a nice error message would be nicer that errors in console. :P
The Script
Stack Trace
Versions
Let me know if you need any more information.
The text was updated successfully, but these errors were encountered: