racket/collects/honu/examples/old/matthias1.honu
Stevie Strickland 7dbb99d3c6 merged 292:296 from branches/sstrickl
svn: r297
2005-07-02 04:03:02 +00:00

24 lines
428 B
Plaintext

type t {
void m();
}
class A():t { // no implements necessary
t state = null;
void m() {
state = this; // do we need coercions here?
}
export t : m;
}
type s <: t { }
subclass B():s extends A at t {
super();
// use of m somewhere
void m2 { m(); }
// .: the type of this is s
// .: the assignment of state = this still works
// because s is below t
export s : m2 as m;
}