parent
8115b655e7
commit
80b0748d75
2 changed files with 19 additions and 0 deletions
|
|
@ -1927,6 +1927,7 @@ proc genRepr(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
genReprAux(p, n, r, "reprJSONStringify")
|
genReprAux(p, n, r, "reprJSONStringify")
|
||||||
else:
|
else:
|
||||||
genReprAux(p, n, r, "reprAny", genTypeInfo(p, t))
|
genReprAux(p, n, r, "reprAny", genTypeInfo(p, t))
|
||||||
|
r.kind = resExpr
|
||||||
|
|
||||||
proc genOf(p: PProc, n: PNode, r: var TCompRes) =
|
proc genOf(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
var x: TCompRes
|
var x: TCompRes
|
||||||
|
|
|
||||||
18
tests/js/treprinifexpr.nim
Normal file
18
tests/js/treprinifexpr.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
type
|
||||||
|
Enum = enum A
|
||||||
|
|
||||||
|
let
|
||||||
|
enumVal = A
|
||||||
|
tmp = if true: $enumVal else: $enumVal
|
||||||
|
|
||||||
|
let
|
||||||
|
intVal = 12
|
||||||
|
tmp2 = if true: repr(intVal) else: $enumVal
|
||||||
|
|
||||||
|
let
|
||||||
|
strVal = "123"
|
||||||
|
tmp3 = if true: repr(strVal) else: $strVal
|
||||||
|
|
||||||
|
let
|
||||||
|
floatVal = 12.4
|
||||||
|
tmp4 = if true: repr(floatVal) else: $floatVal
|
||||||
Loading…
Add table
Add a link
Reference in a new issue