LYR-SEM0124
an extend block on an interface
An 'extend' block names an interface as its target.
Explanation
Methods for every conformer of an interface are added through the generic form, extend<T :: [Walker]> T { … }. extend Walker { … } would be a second spelling of it, and a conformance of an interface to an interface has no meaning either, so the form is refused.
Write the generic form, or put the method into the interface as a default.
Wrong
interface Walker { fn walk(): string; }
extend Walker {
fn describe(): string { return "w"; }
}
fn main(): void {
}
Right
interface Walker { fn walk(): string; }
extend<T :: [Walker]> T {
fn describe(): string { return "w"; }
}
fn main(): void {
}