summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-08-24 01:27:20 +0800
committerGitHub <noreply@github.com>2022-08-23 19:27:20 +0200
commit1182216381cdd17b75e16133ce2c79084dd3d3f9 (patch)
tree85e3c4edea3889dee2125188acc7703dc4072947 /compiler
parent7d7886b729b40872cc2ad7c0c370179b6b39df0c (diff)
downloadNim-1182216381cdd17b75e16133ce2c79084dd3d3f9.tar.gz
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>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index f195c4e45..760ee697d 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -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: