Skip to content

Commit

Permalink
fix copyCandidate
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 29, 2024
1 parent d12cbaa commit 8667359
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ proc newCandidate*(ctx: PContext, callee: PSym,
proc newCandidate*(ctx: PContext, callee: PType): TCandidate =
result = initCandidate(ctx, callee)

proc copyCandidate(dest: var TCandidate, src: TCandidate) =
proc inheritCandidate(dest: var TCandidate, src: TCandidate) =
dest.c = src.c
dest.exactMatches = src.exactMatches
dest.subtypeMatches = src.subtypeMatches
Expand All @@ -282,7 +282,7 @@ proc copyCandidate(dest: var TCandidate, src: TCandidate) =
dest.calleeSym = src.calleeSym
dest.call = copyTree(src.call)
dest.baseTypeMatch = src.baseTypeMatch
dest.bindings = src.bindings
dest.bindings = newTypeMapLayer(src.bindings)

proc checkGeneric(a, b: TCandidate): int =
let c = a.c
Expand Down Expand Up @@ -2568,7 +2568,7 @@ proc paramTypesMatch*(m: var TCandidate, f, a: PType,

for i in 0..<arg.len:
if arg[i].sym.kind in matchSet:
copyCandidate(z, m)
inheritCandidate(z, m)
z.callee = arg[i].typ
if arg[i].sym.kind == skType and z.callee.kind != tyTypeDesc:
# creating the symchoice with the type sym having typedesc type
Expand Down

0 comments on commit 8667359

Please sign in to comment.