Fine: `1.toByte().equals(1)`, not fine (though sug...
# announcements
r
Fine:
1.toByte().equals(1)
, not fine (though suggested):
1.toByte() == 1
d
For one, it is unclear what behaviour is expected
Should the byte value be sign extended (toInt()) before comparison Or should the int be truncated (toByte()) before comparison
r
@Dico the same as happens in the first example. As is described here (https://kotlinlang.org/docs/reference/operator-overloading.html) for the
==
operator. Should translate to
1.toByte.equals(1)
Expression Translates to a == b a?.equals(b) ?: (b === null)