Skip to content

Instantly share code, notes, and snippets.

@ckiee
Created November 29, 2019 05:50
Show Gist options
  • Save ckiee/d635010f6fef0678044aa77c7f51d29a to your computer and use it in GitHub Desktop.
Save ckiee/d635010f6fef0678044aa77c7f51d29a to your computer and use it in GitHub Desktop.
fn main() {
}
struct Example {
cb fn(int, bool) int
}
fn foo(cb fn(int, bool) int) Example {
println(cb(5, true)) // NO ERROR
return Example {
cb: cb
}
}
fn (e Example) bar() int {
println(e.cb(5, true)) // ERROR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment