mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
23
tests/arc/dmodule.nim
Normal file
23
tests/arc/dmodule.nim
Normal file
@@ -0,0 +1,23 @@
|
||||
type
|
||||
MinKind* = enum
|
||||
minDictionary
|
||||
minBool
|
||||
MinValue* = object
|
||||
case kind*: MinKind
|
||||
of minDictionary:
|
||||
symbols: seq[MinOperator]
|
||||
else: discard
|
||||
MinOperator = object
|
||||
|
||||
# remove this inline pragma to make it compile
|
||||
proc `$`*(a: MinValue): string {.inline.} =
|
||||
case a.kind
|
||||
of minDictionary:
|
||||
result = "hello"
|
||||
for i in a.symbols:
|
||||
result = "hello"
|
||||
else: discard
|
||||
|
||||
proc parseMinValue*(): MinValue =
|
||||
# or this echo
|
||||
echo result
|
||||
13
tests/arc/t14383.nim
Normal file
13
tests/arc/t14383.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
discard """
|
||||
cmd: "nim c --gc:arc $file"
|
||||
output: '''
|
||||
hello
|
||||
hello
|
||||
'''
|
||||
"""
|
||||
|
||||
import dmodule
|
||||
|
||||
var val = parseMinValue()
|
||||
if val.kind == minDictionary:
|
||||
echo val
|
||||
Reference in New Issue
Block a user