From 5eee3e06fc1972a3812e7fc60d9f30eed80f6dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Paulo?= Date: Sun, 21 Apr 2024 16:30:12 -0300 Subject: [PATCH] fix #23518 - ` is` crashes nimsuggest (#23523) This solution should resolve the nimsuggest crash issue. However, perhaps the problem is in the parser? fix #23518 (cherry picked from commit 60af04635f44e655c7928da36fc9394e11367d18) --- compiler/semexprs.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a179c68d7b..69f7efa970 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -512,8 +512,9 @@ proc isOpImpl(c: PContext, n: PNode, flags: TExprFlags): PNode = result.typ = n.typ proc semIs(c: PContext, n: PNode, flags: TExprFlags): PNode = - if n.len != 3: + if n.len != 3 or n[2].kind == nkEmpty: localError(c.config, n.info, "'is' operator takes 2 arguments") + return errorNode(c, n) let boolType = getSysType(c.graph, n.info, tyBool) result = n