Last active
August 29, 2015 14:10
-
-
Save eliezedeck/112d92ae108f06c4ebc6 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
# Warning: not GC-safe: 't' [GcUnsafe] -- generated when using objects (t here) that have closures as member. | |
# Compile with --threads:on | |
type | |
TTTTT = object | |
onCalled: proc(i: int) {.closure.} | |
var | |
t: TTTTT # <== This is GCed, so the whole 't' instance is not gcsafe | |
x = 0 | |
t.onCalled = proc(i: int) {.closure.} = # <== warning here | |
echo "Dummy closure proc, " & $i | |
t.onCalled(x) # <== warning here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment