~mna/snow

snow/pkg/semantic/testdata/fn_assign_call_interface.snow -rw-r--r-- 216 bytes
424066c5Martin Angers doc: v0.0.5 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
interface I {
  fn foo()
}

struct S {
  let s: string

  fn foo() {
    println(s)
  }
}

@extern(import: "fmt", symbol: "Println")
fn println(s: string)

fn main() {
  let iface: I = S(s: "hello!")
  iface.foo()
}