Re:The Unsound Playground: Java and Scala's Type Systems are...
by olliej on Sunday November 27, 2016 @03:21PM
(#13051273)
Just to further clarify, the existence (or not) an _explicit_ cast operator is not necessary to create an implicit cast that might fail. The dumbest case being due to the contra variant array semantics that say i can do this:
Object[] foo = new String[10]
foo[0] = new Integer(1)
which is the type error, even if the reported error is something akin to a "array store error" or something (it's been a long time since i did java programming :D)
Object[] foo = new String[10] foo[0] = new Integer(1)
which is the type error, even if the reported error is something akin to a "array store error" or something (it's been a long time since i did java programming :D)