fixes #20155; repr range with distinct types is broken with ORC (#20158)

* fixes #20155; repr range with distinct types is broken with ORC

* skipRanges
This commit is contained in:
ringabout 2022-09-12 04:55:22 +08:00 • committed by GitHub
commit 37b3f62eef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -190,6 +190,9 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
arg = arg.base.skipTypes(skippedTypes + {tyGenericInst})
if not rec: break
result = getTypeDescNode(c, arg, operand.owner, traitCall.info)
of "skipRanges":
var arg = operand.skipTypes({tyRange})
result = getTypeDescNode(c, arg, operand.owner, traitCall.info)
else:
localError(c.config, traitCall.info, "unknown trait: " & s)
result = newNodeI(nkEmpty, traitCall.info)