diff options
author | metagn <metagngn@gmail.com> | 2024-08-16 09:22:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 08:22:49 +0200 |
commit | 995081b56a098c431eb24fbb37afadb4cee2fb4b (patch) | |
tree | 9220d8068ec0478e77e414b721fe9fc3ec275f8f /tests | |
parent | d43a5954c5e179c5ef270bb7b48bcab7288ddba5 (diff) | |
download | Nim-995081b56a098c431eb24fbb37afadb4cee2fb4b.tar.gz |
fix `is` with `type`/`typedesc` crashing the compiler (#23967)
fixes #22850 The `is` operator checks the type of the left hand side, and if it's generic or if it's a `typedesc` type with no base type, it leaves it to be evaluated later. But `typedesc` types with no base type precisely describe the default typeclass `type`/`typeclass`, so this condition is removed. Maybe at some point this represented an unresolved generic type?
Diffstat (limited to 'tests')
-rw-r--r-- | tests/types/tisopr.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/types/tisopr.nim b/tests/types/tisopr.nim index 64b3d03c0..c95b63c90 100644 --- a/tests/types/tisopr.nim +++ b/tests/types/tisopr.nim @@ -165,3 +165,7 @@ block: # previously tisop.nim doAssert f.y.typeof is float doAssert f.z.typeof is float p(A, f) + +block: # issue #22850 + doAssert not (type is int) + doAssert not (typedesc is int) |