parent
c8418651b1
commit
46bfb590c8
2 changed files with 21 additions and 5 deletions
|
|
@ -2,6 +2,7 @@ discard """
|
|||
output: '''
|
||||
success
|
||||
M1 M2
|
||||
ok
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -39,7 +40,8 @@ type
|
|||
var k = PFuture[void]()
|
||||
|
||||
|
||||
##bug #9297
|
||||
##bug #9297 and #13281
|
||||
|
||||
import strutils
|
||||
|
||||
type
|
||||
|
|
@ -58,6 +60,14 @@ type
|
|||
of M2: b:float
|
||||
of M3: c:cstring
|
||||
|
||||
Helper* {.exportc: "PublicHelper".} = object
|
||||
case isKind: bool
|
||||
of true:
|
||||
formatted: string
|
||||
of false:
|
||||
parsed1: string
|
||||
parsed2: string
|
||||
|
||||
proc newMyObject(kind: MyKind, val: string): MyObject =
|
||||
result = MyObject(kind: kind)
|
||||
|
||||
|
|
@ -75,3 +85,9 @@ proc newMyObjectRef(kind: MyKind, val: string): MyObjectRef =
|
|||
|
||||
|
||||
echo newMyObject(M1, "2").kind, " ", newMyObjectRef(M2, "3").kind
|
||||
|
||||
|
||||
proc test(c: Helper): string =
|
||||
c.formatted
|
||||
|
||||
echo test(Helper(isKind: true, formatted: "ok"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue