flyx / NimYAML

YAML implementation for Nim
https://nimyaml.org
Other
191 stars 36 forks source link

Cannot construct to int32: 0; error: index out of bounds #60

Closed alehander92 closed 6 years ago

alehander92 commented 6 years ago

I have a weird error: I can't seem to load 0

%YAML 1.2
number: 0
import yaml.serialization, streams, os

type 
  Value = object
    number: int

var raw = newFileStream("a.yaml", fmRead)
var value: Value
load(raw, value)
echo value

If I run this on the yaml, I get the error. If I change number to anything != 0 it seems to work

Is it a known problem and is it easy to fix ? I use nim devel(> 0.18.1)

flyx commented 6 years ago

Not a known problem. Can you provide a stacktrace of the error?

alehander92 commented 6 years ago

sorry for not debugging it immeditely, it's a simple fix

https://github.com/flyx/NimYAML/pull/61