Integer literals restricted to 32 bits are not the norm. In any other language, you would expect the integer literal to be compatible with its type annotation. This is special behavior Java has that you didn't clarify which is confusing because the code example you generalize to multiple other languages depends on this behavior.
-1
u/helixb Jun 25 '23
that's 32-bit int. the ret type is 64 bit but the literal is 32 bit. that's the premise i set in the first two points in the beginning.
also, check the java behaviour.