About the new `full value classes` and them having...
# getting-started
u
About the new
full value classes
and them having no identity so === is a comp time error.. they also extend
Any
, right? So if iO cast down to Any and then triple equals it… is that then undefined?
m
NB: Full value classes are in Alpha, which means their design is not finalized, and it will take several iterations to do so. For your question, the behavior of
===
visible through
Any
is implementation-defined, similarly to what currently happens for the same code, but with `@JvmInline value class`es. Whether you would observe the same or different boxes (and results of
===
) depends on what the compiler does. Before Valhalla comes on the JVM (and is supported on Android), that's what will happen. Afterwards
===
changes to being structural for value types on the JVM, and we have plans to support the same structural behavior on other platforms. Case in point: by the time full value classes are Stable, you would have mechanisms to ensure
===
works consistently between all relevant platforms.
thank you color 1