updating the compiler to recognize class-level variables accessors prefixed with self/super in assignment expressions
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
70828ac110
commit
5521a0c81e
23
t/class-01.err
Normal file
23
t/class-01.err
Normal file
@ -0,0 +1,23 @@
|
||||
defclass B | x y | {
|
||||
|
||||
};
|
||||
|
||||
defclass X ::: B | a b | {
|
||||
defun ::* new(t) {
|
||||
| a |
|
||||
set self.a t;
|
||||
set a 100;
|
||||
set self.b (* t 2);
|
||||
|
||||
set self.c (fun(b) { ##ERROR: unknown class-level variable name
|
||||
printf "xxxx [%d]\n" b;
|
||||
});
|
||||
return self;
|
||||
};
|
||||
|
||||
defun print() {
|
||||
self.c (+ self.a self.b);
|
||||
printf "a=%d b=%d\n" self.a self.b;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user