Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Oct 2, 2024
1 parent a13fbca commit a20ff29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1971,9 +1971,8 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
if f.len > 0 and f[0].kind != tyNone:
c.bindings = newTypeMapLayer(c.bindings)
result = typeRel(c, f[0], a, flags + {trBindGenericParam})
if result == isGeneric:
bound = lookup(c.bindings, f[0])
else:
bound = lookup(c.bindings, f[0])
if bound == nil and result != isGeneric:
bound = f[0]
setToPreviousLayer(c.bindings)
if doBindGP and result notin {isNone, isGeneric}:
Expand Down
5 changes: 5 additions & 0 deletions tests/overload/torconv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ block: # issue #15721, set
block: # issue #21331
let a : int8 | uint8 = 3
doAssert sizeof(a)==sizeof(int8) # this fails

block:
let x: range[0..5] = 1
proc foo[T: SomeInteger](x: T): string = $typeof(x)
discard foo(x)

0 comments on commit a20ff29

Please sign in to comment.