Improve compiler messages (#22040)

* Improve compiler messages
This commit is contained in:
Juan Carlos
2023-06-07 19:09:09 -03:00
committed by GitHub
parent d29237b3c7
commit ea91cfb305

View File

@@ -285,7 +285,7 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType =
elif not isOrdinalType(rangeT[0]) and rangeT[0].kind notin {tyFloat..tyFloat128} or
rangeT[0].kind == tyBool:
localError(c.config, n.info, "ordinal or float type expected")
localError(c.config, n.info, "ordinal or float type expected, but got " & typeToString(rangeT[0]))
elif enumHasHoles(rangeT[0]):
localError(c.config, n.info, "enum '$1' has holes" % typeToString(rangeT[0]))