diff --git a/compiler/ast2nif.nim b/compiler/ast2nif.nim index 67a265c28f..157159f321 100644 --- a/compiler/ast2nif.nim +++ b/compiler/ast2nif.nim @@ -523,9 +523,7 @@ proc writeNode(w: var Writer; dest: var TokenBuf; n: PNode; forAst = false) = of nkEmpty: if n.typField != nil: w.withNode dest, n: - let info = trLineInfo(w, n.info) - dest.addParLe pool.tags.getOrIncl(toNifTag(n.kind)), info - dest.addParRi + discard else: let info = trLineInfo(w, n.info) dest.addParLe pool.tags.getOrIncl(toNifTag(n.kind)), info diff --git a/tests/ic/tconverter.nim b/tests/ic/tconverter.nim new file mode 100644 index 0000000000..e639d99247 --- /dev/null +++ b/tests/ic/tconverter.nim @@ -0,0 +1,17 @@ +discard """ +output: +ok +""" + +type + Meters = distinct float + Feet = distinct float + +converter toMeters(f: Feet): Meters = + Meters(float(f) * 0.3048) + +proc showMeters(m: Meters) = + doAssert float(m) == 3.048 + echo "ok" + +showMeters(Feet(10.0))