Last active
April 1, 2017 20:53
-
-
Save singularperturbation/79d4e5fbc9dea5999ce4923dce5dd6d1 to your computer and use it in GitHub Desktop.
Error with create / createShared in current devel (5fdd03ad4d2a) of Nim
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
type Foo = object | |
fooInt*: int | |
proc main() = | |
# Error: type mismatch: got (ptr Foo) but expected 'ptr None' | |
var f = create(Foo) | |
f.fooInt = 3 | |
echo $f | |
discard realloc(f, 0) | |
var g = Foo() | |
g.fooInt = 3 | |
echo $g | |
when isMainModule: | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the problem is with passing the typedesc as a proc parameter, if I use:
as a workaround then this will work.