Skip to content

Commit

Permalink
[backport 2.0] nimsuggest fix (#23336)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez authored Mar 4, 2024
1 parent 2f15b67 commit 0de70dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0de70dc

Please sign in to comment.