new-style concept bugfix (#24858)

Combining two small PRs in one here. The test case explains what was
wrong with the concepts and for naitivesockets, it's typical to adjust
`ai_flags` so I opened that up.

(cherry picked from commit d4098e6ca0)
This commit is contained in:
Ryan McConnell
2025-04-11 00:54:52 -04:00
committed by narimiran
parent 72190536cb
commit ee44fe197b
2 changed files with 28 additions and 1 deletions

View File

@@ -347,10 +347,11 @@ proc matchType(c: PContext; fo, ao: PType; m: var MatchCon): bool =
k1 = f.kidsLen - ord(f.kind == tyGenericInst)
k2 = ea.kidsLen - ord(ea.kind == tyGenericInst)
if sameType(f.genericHead, ea.genericHead) and k1 == k2:
result = true
for i in 1 ..< k2:
if not matchType(c, f[i], ea[i], m):
result = false
break
result = true
of tyOrdinal:
result = isOrdinalType(a, allowEnumWithHoles = false) or a.kind == tyGenericParam
of tyStatic: