logoalt Hacker News

xmcqdpt2today at 12:27 PM1 replyview on HN

Java also has covariant mutable arrays. I can't believe they created the whole language and didnt realize that covariant arrays are unsound? Or didn't care?


Replies

kccqzytoday at 2:29 PM

They didn’t care about preventing all unsoundness at type check time. As long as JVM can detect it and throw an exception, it’s good enough for Java.