20 Mar
2010
20 Mar
'10
11:47 a.m.
Here's a self-contained example that demonstrates what I mean: class Obs {} class SubObs extends Obs {} fun void count(Obs elems[]) { <<< elems.size() >>>; } // works... [(new Obs), (new Obs)] @=> Obs @ x1[]; count(x1); // works but is really ugly.. [(new SubObs) $ Obs, (new SubObs) $ Obs] @=> Obs x2[]; count(x2); // Doesn't work: needs casting. but what's the syntax? [(new SubObs), (new SubObs)] @=> SubObs @ x3[]; count(x3);