Created
March 29, 2014 01:28
-
-
Save Skrylar/9846618 to your computer and use it in GitHub Desktop.
Produces an "invalid type: Receivers" compile error, instead of warning that proc(x) should be proc(x:type).
This file contains hidden or 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
type | |
FHandler = proc(x) {.closure.} | |
Receivers = seq[FHandler] | |
Beans = object | |
floor: bool | |
proc Emit(self: Receivers; x: int) = | |
for e in items(self): | |
e(x) | |
var pinto = Beans(floor: false) | |
var lst: Receivers = @[] | |
lst.emit 44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment