This commit is contained in:
Andreas Rumpf 2021-06-29 15:34:39 +02:00 • committed by GitHub
commit 97fc95012d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -1341,8 +1341,13 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
result = isSubtype
else:
result = typeRel(c, f[0], a[0], flags)
if result <= isConvertible:
result = isNone # BUGFIX!
if result < isGeneric:
if result <= isConvertible:
result = isNone
elif tfIsConstructor notin a.flags:
# set constructors are a bit special...
result = isNone
of tyPtr, tyRef:
skipOwned(a)
if a.kind == f.kind: