diff --git a/tests/arc/dmodule.nim b/tests/arc/dmodule.nim new file mode 100644 index 0000000000..455ec70846 --- /dev/null +++ b/tests/arc/dmodule.nim @@ -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 diff --git a/tests/arc/t14383.nim b/tests/arc/t14383.nim new file mode 100644 index 0000000000..115cbf426b --- /dev/null +++ b/tests/arc/t14383.nim @@ -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