Skip to content

Commit

Permalink
fix #23518 - <expr> is crashes nimsuggest (#23523)
Browse files Browse the repository at this point in the history
This solution should resolve the nimsuggest crash issue. However,
perhaps the problem is in the parser?

fix #23518
  • Loading branch information
rockcavera committed Apr 21, 2024
1 parent 1185b93 commit 60af046
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,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
Expand Down

0 comments on commit 60af046

Please sign in to comment.