Merge pull request #3385 from nanoant/patch/dont-fail-on-unknown-enum-value-to-string

vm: Don't fail on unknown enum position to string
This commit is contained in:
Andreas Rumpf
2015-09-30 21:09:17 +02:00

View File

@@ -311,7 +311,7 @@ proc opConv*(dest: var TFullReg, src: TFullReg, desttyp, srctyp: PType): bool =
if f.position == x:
dest.node.strVal = if f.ast.isNil: f.name.s else: f.ast.strVal
return
internalError("opConv for enum")
dest.node.strVal = styp.sym.name.s & " " & $x
of tyInt..tyInt64:
dest.node.strVal = $src.intVal
of tyUInt..tyUInt64: