[Grace-core] [A Graceful Blog] Comment: "From Lancaster to Portland"

Eric Tanter etanter at dcc.uchile.cl
Tue Oct 11 04:19:13 PDT 2011


Dear all,

On Sep 26, 2011, at 9:23 PM, Kim Bruce wrote:
> In fact, as I now recall, we ran into this with an OOPSLA paper where we ran into problems with typing conditional expressions, and we found we needed the entire lattice.  Because Java has conditional expressions, but no sups or infs (because of nominal typing), they do not fully support subtyping.  If expT: A <: C and expE: B <: C then "boolExp? expT: expE" is not typable in Java, even though it clearly has type C.

I don't understand this -- the following:

C c = (x < 10) ? new A() : new B();

does type correctly in Java with A <: C and B <: C

am I missing something?

Thanks!

-- Éric


More information about the Grace-core mailing list