From 1c151770fe1ce9c5ea55fddc6efd5c9e6bf5de45 Mon Sep 17 00:00:00 2001 From: Vindaar Date: Fri, 9 Feb 2024 11:26:54 +0100 Subject: [PATCH] fix `isAUnit` for appearance of `nnkPostfix` nodes --- src/unchained/define_units.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/unchained/define_units.nim b/src/unchained/define_units.nim index 73676ae..51ea0ba 100644 --- a/src/unchained/define_units.nim +++ b/src/unchained/define_units.nim @@ -720,9 +720,11 @@ macro isAUnit*(x: typed): untyped = ## `getUnitTypeImpl` & making use of CT tables (possibly of objects?) let x = x.resolveAlias() case x.kind - of nnkSym, nnkDistinctTy: + of nnkSym, nnkDistinctTy, nnkPostfix: let typ = x - var xT = if typ.kind == nnkDistinctTy: typ[0] else: typ + var xT = if typ.kind == nnkDistinctTy: typ[0] + elif typ.kind == nnkPostfix: typ[1] + else: typ while xT.strVal notin quantityList(): xT = xT.getTypeImpl case xT.kind