From 0de70dc7f35a5f7ada838a0a886878b5c9e50278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20M=20G=C3=B3mez?= Date: Mon, 4 Mar 2024 08:58:54 +0000 Subject: [PATCH] [backport 2.0] nimsuggest fix (#23336) --- compiler/semtypes.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 07229bfa68..53effed51f 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -2114,6 +2114,9 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = else: let symKind = if n.kind == nkIteratorTy: skIterator else: skProc result = semProcTypeWithScope(c, n, prev, symKind) + if result == nil: + localError(c.config, n.info, "type expected, but got: " & renderTree(n)) + result = newOrPrevType(tyError, prev, c) if n.kind == nkIteratorTy and result.kind == tyProc: result.flags.incl(tfIterator) of nkEnumTy: result = semEnum(c, n, prev)