eo
eo copied to clipboard
Can't dataize integer or float
I think it's necessary to notify users of EO that we can't dataize integer or float like this:
[] > app
5 > @
Here is output after eoc dataize app
:
Exception in thread "main" java.lang.ClassCastException: Cannot cast java.lang.Long to java.lang.Boolean
at java.base/java.lang.Class.cast(Class.java:3605)
at org.eolang.Dataized.take(Dataized.java:127)
at org.eolang.Main.run(Main.java:190)
at org.eolang.Main.main(Main.java:98)
Or maybe I do smth wrong?
@yegor256 please, have a look.
@mximp currently, in org.eolang.Main
we have this code:
if (!new Dataized(app).take(Boolean.class)) {
throw new IllegalStateException(
"Runtime dataization failure"
);
}
In other words, we expect the object being dataized to become a Boolean
. In the example above, it becomes a Long
, that's why the exception. Let's change Main
so that it doesn't fail, but instead print the result of dataization.
@Nypiaka please have a look
@yasamprom please assist
@yasamprom What's up with this issue?
@Graur there is PR open which is still in code review. I believe someone needs to take this over.
@mximp @Graur there was a problem with possible runtime error but I think it is fixed now. Check please
@mximp still a bug?
@yegor256 Still open bug. Needed to be fixed.