From ea91cfb3050bac5c808ed8ab08e12cd33f1dc8ff Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 7 Jun 2023 19:09:09 -0300 Subject: [PATCH] Improve compiler messages (#22040) * Improve compiler messages --- compiler/semtypes.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 503e2fde898a..14ad72fcaeed 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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]))