Solution to method redefinition problem
- Object types:
- N2: rec .[/selftype]
{NUM: intloc, EQ: selftype boolexp}
- I2: rec .[/selftype]
{NUM: intloc, ISNEG: boolloc,
EQ: selftype boolexp}
- Resolution of selftype
- = {NUM: intloc, EQ: boolexp}
- = {NUM: intloc, ..., EQ:
boolexp}
- <= does not imply
boolexp <= boolexp!
- call Q(I2) is not well-typed!
- Methods that take objects as parameters can destroy subtype relation!
- C++: methods in subclasses must have same argument types.
OO typing systems still topic of research!