diff options
-rw-r--r-- | compiler/semexprs.nim | 3 | ||||
-rw-r--r-- | tests/types/tisopr.nim | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index d49f115ea..e2a4df3ff 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -611,8 +611,7 @@ proc semIs(c: PContext, n: PNode, flags: TExprFlags): PNode = n[1] = makeTypeSymNode(c, lhsType, n[1].info) lhsType = n[1].typ else: - if lhsType.base.kind == tyNone or - (c.inGenericContext > 0 and lhsType.base.containsGenericType): + if c.inGenericContext > 0 and lhsType.base.containsGenericType: # BUGFIX: don't evaluate this too early: ``T is void`` return 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) |