Skip to content

Commit

Permalink
fix isAUnit for appearance of nnkPostfix nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Feb 9, 2024
1 parent 93f5e36 commit 1c15177
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/unchained/define_units.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c15177

Please sign in to comment.