Difference between Scala’s existential types and Java’s wildcard by example?

This is Martin Odersky’s answer on the Scala-users mailing list:

The original Java wildcard types (as described in the ECOOP paper by
Igarashi and Viroli) were indeed just shorthands for existential
types. I am told and I have read in the FOOL ’05 paper on Wild FJ that
the final version of wildcards has some subtle differences with
existential types. I would not know exactly in what sense (their
formalism is too far removed from classical existential types to be
able to pinpoint the difference), but maybe a careful read of the Wild
FJ paper would shed some light on it.

So it does seem that Scala existential types and Java wildcards are kind-of equivalent

Leave a Comment