summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sigmatch.nim2
-rw-r--r--tests/overload/t23755.nim10
2 files changed, 12 insertions, 0 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 9595ac62b..18170ecfc 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -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)
diff --git a/tests/overload/t23755.nim b/tests/overload/t23755.nim
index 3d06cee65..de338a2ce 100644
--- a/tests/overload/t23755.nim
+++ b/tests/overload/t23755.nim
@@ -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)