Created
November 29, 2019 05:50
-
-
Save ckiee/d635010f6fef0678044aa77c7f51d29a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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