mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
@@ -1927,6 +1927,7 @@ proc genRepr(p: PProc, n: PNode, r: var TCompRes) =
|
||||
genReprAux(p, n, r, "reprJSONStringify")
|
||||
else:
|
||||
genReprAux(p, n, r, "reprAny", genTypeInfo(p, t))
|
||||
r.kind = resExpr
|
||||
|
||||
proc genOf(p: PProc, n: PNode, r: var 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
|
||||
Reference in New Issue
Block a user