24 lines
428 B
Plaintext
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;
|
|
}
|