Skip to content

Commit dfb9562

Browse files
committed
fix isAUnit for appearance of nnkPostfix nodes
1 parent 0ba909a commit dfb9562

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/unchained/define_units.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,11 @@ macro isAUnit*(x: typed): untyped =
720720
## `getUnitTypeImpl` & making use of CT tables (possibly of objects?)
721721
let x = x.resolveAlias()
722722
case x.kind
723-
of nnkSym, nnkDistinctTy:
723+
of nnkSym, nnkDistinctTy, nnkPostfix:
724724
let typ = x
725-
var xT = if typ.kind == nnkDistinctTy: typ[0] else: typ
725+
var xT = if typ.kind == nnkDistinctTy: typ[0]
726+
elif typ.kind == nnkPostfix: typ[1]
727+
else: typ
726728
while xT.strVal notin quantityList():
727729
xT = xT.getTypeImpl
728730
case xT.kind

0 commit comments

Comments
 (0)