You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is perfectly ok according to the Scala compiler: if 1.0f < 0 then ... but does not compile to GLSL because they both need to be floats, i.e.: if 1.0f < 0.0 then ...
You get a compile error in the browser logs, but it would be nice to catch this at Scala compile time.
The text was updated successfully, but these errors were encountered:
...and it's easy enough in theory, you just need to make sure the type on the left is the same as the type on the right. However in practice, as soon as you introduce a variable then at the point of comparison, you don't have the type immediately to hand.
I did try doing a "best effort" comparison, knowing the names of the types we care about we can just check, right? Well, no, because the Scala compile thinks comparing float and double is totally ok, and inlines known values and whole if statements before we can even check them. 😄
So plan B might be to add it to the program validation step, which is only slightly better than the current behaviour.
This is perfectly ok according to the Scala compiler:
if 1.0f < 0 then ...
but does not compile to GLSL because they both need to be floats, i.e.:if 1.0f < 0.0 then ...
You get a compile error in the browser logs, but it would be nice to catch this at Scala compile time.
The text was updated successfully, but these errors were encountered: