concept patch for tyGenericInvocation (#25288)

matching between some generic invocations and equivalent instantiations
did not have a code path
This commit is contained in:
Ryan McConnell
2025-11-15 06:52:16 -05:00
committed by GitHub
parent 7cb8165e75
commit 79ddb7d89e
2 changed files with 48 additions and 1 deletions

View File

@@ -546,3 +546,42 @@ proc len[T](t: DummyIndexable[T]): int =
let dummyIndexable = DummyIndexable(@[1, 2])
echoAll(dummyIndexable)
block:
type
C = concept
proc a(x: Self, i: int)
AObj[T] = object
x: T
ARef[T] = ref AObj[T]
proc a[T: int](x: ARef[T], i: int) =
discard
assert (ref AObj[int]) is C
block:
type
C = concept
proc a(x: Self, i: int)
AObj[T; B] = object
x: T
ARef[T; B] = ref AObj[T,B]
proc a[T: int, C: float](x: ARef[T, C], i: int) =
discard
assert (ref AObj[int, int]) isnot C
assert (ref AObj[int, float]) is C
block:
type
C = concept
proc a(x: Self, i: int)
AObj[T] = object
ARef[T] = ref AObj[T]
proc a(x: ARef, i: int) =
discard
assert (ref AObj[int]) is C