File interface created

This commit is contained in:
Vinicius Silva 2024-01-22 22:23:27 -03:00
parent 7a5d384d66
commit b800b3c07b
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
module main
interface Foo{
write(string) string
}
interface Bar{
mut:
write(string) string
}
struct MyStruct{}
fn (s MyStruct) write(a string) string{
return a
}
fn main(){
s1 := MyStruct{}
fn1(s1)
}
fn fn1(s Foo){
println(s.write('Foo'))
}