fixes repr regression

This commit is contained in:
Andreas Rumpf
2017-01-27 07:06:22 +01:00
parent 8d3d9ce5cc
commit cb6c975d3a

View File

@@ -277,7 +277,9 @@ when not defined(useNimRtl):
of tyEnum: add result, reprEnum(getInt(p, typ.size), typ)
of tyBool: add result, reprBool(cast[ptr bool](p)[])
of tyChar: add result, reprChar(cast[ptr char](p)[])
of tyString: reprStrAux(result, cast[ptr string](p)[], cast[ptr string](p)[].len)
of tyString:
let sp = cast[ptr string](p)
reprStrAux(result, if sp[].isNil: nil else: sp[].cstring, sp[].len)
of tyCString:
let cs = cast[ptr cstring](p)[]
if cs.isNil: add result, "nil"