mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
better error message for invalid types
This commit is contained in:
@@ -1750,7 +1750,9 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
|
||||
markUsed(c.config, n.info, n.sym, c.graph.usageSym)
|
||||
onUse(n.info, n.sym)
|
||||
else:
|
||||
if s.kind != skError: localError(c.config, n.info, errTypeExpected)
|
||||
if s.kind != skError:
|
||||
localError(c.config, n.info, "type expected, but got symbol '$1' of kind '$2'" %
|
||||
[s.name.s, substr($s.kind, 2)])
|
||||
result = newOrPrevType(tyError, prev, c)
|
||||
of nkObjectTy: result = semObjectNode(c, n, prev, isInheritable=false)
|
||||
of nkTupleTy: result = semTuple(c, n, prev)
|
||||
|
||||
Reference in New Issue
Block a user