Skip to content

Instantly share code, notes, and snippets.

@Skrylar
Created March 29, 2014 01:28
Show Gist options
  • Save Skrylar/9846618 to your computer and use it in GitHub Desktop.
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).
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