dusklang / dusk

The Dusk Programming Language
Other
0 stars 0 forks source link

Don't allow calling methods on wrong instantiations of generic type #130

Open zachwolfe opened 8 months ago

zachwolfe commented 8 months ago

Consider the following structure Foo and its associated extend block:

Foo<|T|> :: struct { foo: T }

extend Foo<|i32|> {
    fn do_something() {
    }
}

The following code currently compiles:

Foo<|f32|>.do_something()

An error should be reported here, because the declaration of do_something is conditional on T == i32.