Lyricdev
GitHub

LYR-SEM0127

a value for an interface's static 'let'

error ยท spec 05-interfaces

A 'static let' in an interface is given a value.

Explanation

An interface's constant is a declaration: every conforming type answers it with a static let of its own, read as T.size. A value written in the interface would belong to no type.

Drop the value from the interface and give it in each conforming type.

Wrong

interface Sized {
    static let size: int = 8;
}

fn main(): void {
}
interface Sized {
    static let size: int;
}

fn main(): void {
}