fix #23518 - <expr> 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 60af04635f)
This commit is contained in:
José Paulo
2024-04-21 16:30:12 -03:00
committed by narimiran
parent dbbd2c8002
commit 5eee3e06fc

View File

@@ -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