From b4efcbdbf6e4f15b81b0d8fe3ca5eea9c51e5633 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:15:12 +0800 Subject: [PATCH] progress Co-authored-by: Copilot --- compiler/sigmatch.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index f2501feec9..39dc44eb2e 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1456,6 +1456,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, return isNone if fRange.rangeHasUnresolvedStatic: + if trCheckGeneric in flags and aOrig.kind == tyArray and + aOrig.indexType.kind == tyGenericParam: + return isNone if (aRange.kind in {tyGenericParam} and aRange.reduceToBase() == aRange) or (aRange.kind == tyRange and aRange.rangeHasUnresolvedStatic): return @@ -1463,6 +1466,9 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, elif c.c.matchedConcept != nil and aRange.rangeHasUnresolvedStatic: return inferStaticsInRange(c, aRange, f) elif result == isGeneric and concreteType(c, aa, ff) == nil: + if indexRel != isGeneric: + return isNone + elif trCheckGeneric in flags and aRange.kind == tyGenericParam: return isNone else: if lengthOrd(c.c.config, fRange) != lengthOrd(c.c.config, aRange):