Skip to content

Commit

Permalink
fixes 23823; array static overload - again (#23824)
Browse files Browse the repository at this point in the history
  • Loading branch information
Graveflo committed Jul 11, 2024
1 parent 173b8a8 commit 22ba5ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,8 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
return isNone

if fRange.rangeHasUnresolvedStatic:
if aRange.kind in {tyGenericParam} and aRange.reduceToBase() == aRange:
return
return inferStaticsInRange(c, fRange, a)
elif c.c.matchedConcept != nil and aRange.rangeHasUnresolvedStatic:
return inferStaticsInRange(c, aRange, f)
Expand Down
10 changes: 10 additions & 0 deletions tests/overload/t23755.nim
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ block:

var g: array[32, char]
doAssert p(g)

block: # issue #23823
func p[N,T](a, b: array[N,T]) =
discard

func p[N: static int; T](x, y: array[N, T]) =
discard

var a: array[5, int]
p(a,a)

0 comments on commit 22ba5ab

Please sign in to comment.