Fixed concept constraints for static types (#19391)
This commit is contained in:
parent
a93f6e7acc
commit
7bdfeb7819
2 changed files with 71 additions and 25 deletions
|
|
@ -1634,6 +1634,15 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
|||
bindConcreteTypeToUserTypeClass(matched, a)
|
||||
if doBind: put(c, f, matched)
|
||||
result = isGeneric
|
||||
elif a.len > 0 and a.lastSon == f:
|
||||
# Needed for checking `Y` == `Addable` in the following
|
||||
#[
|
||||
type
|
||||
Addable = concept a, type A
|
||||
a + a is A
|
||||
MyType[T: Addable; Y: static T] = object
|
||||
]#
|
||||
result = isGeneric
|
||||
else:
|
||||
result = isNone
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue