From 6dbfdecd74de1d8a4b53a095af85169951454a89 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 30 Apr 2018 12:07:12 +0200 Subject: [PATCH] make msgs.nim more robust --- compiler/msgs.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 5ae2c49700..838735753d 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -474,6 +474,10 @@ const hintMin* = hintSuccess hintMax* = high(TMsgKind) +static: + doAssert HintsToStr.len == ord(hintMax) - ord(hintMin) + 1 + doAssert WarningsToStr.len == ord(warnMax) - ord(warnMin) + 1 + type TNoteKind* = range[warnMin..hintMax] # "notes" are warnings or hints TNoteKinds* = set[TNoteKind]