-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
marshal.load() regression? #7854
Comments
I'm having the same issue after pulling devel. |
Since I was curious what the issue is, I tried to remove everything that's not needed from the example in the OP. It seems to come down to a generic type
Stream* = ref StreamObj
StreamObj* = object of RootObj
InhStream* = ref InhStreamObj
InhStreamObj* = object of Stream
f: string
proc newInhStream*(f: string): InhStream =
new(result)
result.f = f
var val: int
let str = newInhStream("input_file.json")
block:
# works:
proc load[T](data: var T, s: Stream) =
discard
load(val, str)
block:
# works
proc load[T](s: Stream, data: T) =
discard
load(str, val)
block:
# broken
proc load[T](s: Stream, data: var T) =
discard
load(str, val) edit: specifying |
Example program:
Gives compilation error:
Error: for a 'var' type a variable needs to be passed; but 'seq[MyType](list)' is immutable
Nim Compiler Version 0.18.1 [Linux: amd64]
Compiled at 2018-05-20
git hash: dedf0f3
active boot switches: -d:release
Works with Nim 0.18.0.
The text was updated successfully, but these errors were encountered: