trait MyTrait {
static fun foo(): void;
static fun bar(): void {
static::foo();
}
}
Gives the error:
File "/home/ci/skfs/lexer.sk", line 6, characters 5-17:
Invalid abstract call
4 | static fun foo(): void;
5 | static fun bar(): void {
6 | static::foo();
| ^^^^^^^^^^^^^
7 | }
File "/home/ci/skfs/lexer.sk", line 4, characters 14-16:
'foo' is abstract. It can be used only from 'static' or a Concrete<_> object
2 |
3 | trait MyTrait {
4 | static fun foo(): void;
| ^^^
5 | static fun bar(): void {
So I discussed it with Todd Nowacki. We could force methods inherited from traits to be deferred by default ... but that comes with another bag of problems ... Leaving it like that for now.
The following program:
trait MyTrait { static fun foo(): void; static fun bar(): void { static::foo(); } }
Gives the error: File "/home/ci/skfs/lexer.sk", line 6, characters 5-17: Invalid abstract call 4 | static fun foo(): void; 5 | static fun bar(): void { 6 | static::foo(); | ^^^^^^^^^^^^^ 7 | }
File "/home/ci/skfs/lexer.sk", line 4, characters 14-16: 'foo' is abstract. It can be used only from 'static' or a Concrete<_> object 2 | 3 | trait MyTrait { 4 | static fun foo(): void; | ^^^ 5 | static fun bar(): void {