remove a special case in sigmatch; distinct pointer types no longer match nil type (#20251)
* remove a special case in sigmatch; distinct pointer types no longer match `nil` type * add tests * fixes tests * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
parent
7d7886b729
commit
1182216381
4 changed files with 30 additions and 15 deletions
|
|
@ -1305,8 +1305,6 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
|||
if sameDistinctTypes(f, a): result = isEqual
|
||||
#elif f.base.kind == tyAnything: result = isGeneric # issue 4435
|
||||
elif c.coerceDistincts: result = typeRel(c, f.base, a, flags)
|
||||
elif a.kind == tyNil and f.base.kind in NilableTypes:
|
||||
result = f.allowsNil # XXX remove this typing rule, it is not in the spec
|
||||
elif c.coerceDistincts: result = typeRel(c, f.base, a, flags)
|
||||
of tySet:
|
||||
if a.kind == tySet:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue