Skip to content

Commit

Permalink
still copy arg, fixes typetraits somehow
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 28, 2024
1 parent 756301b commit 6b5e4ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2338,9 +2338,10 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
# if for some reason the conversion can't be evaluated,
# like if a converter is runtime-only
if evaluated == nil: return nil
# to avoid creating recursive types, copy the node (#9255, #12864)
# original version copied `arg` and not `evaluated`
let typ = makeStaticType(c, evaluated.typ, evaluated.copyTree)
# Don't build the type in-place because `evaluated` and `arg` may point,
# to the same object and we'd end up creating recursive types (#9255)
let typ = makeStaticType(c, evaluated.typ, evaluated)
arg = copyTree(arg) # fix #12864
arg.typ = typ
a = typ
else:
Expand Down

0 comments on commit 6b5e4ea

Please sign in to comment.