summary refs log tree commit diff stats
path: root/compiler/msgs.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-01-20 01:49:59 -0800
committerGitHub <noreply@github.com>2021-01-20 10:49:59 +0100
commit4fc7fcb775140dc774a713063917fbf7d1392bdf (patch)
treeffb29f080816cc85e7a47a96cde8e79945d023a8 /compiler/msgs.nim
parent2bedb0fe2c38424a53ec7376c05db09090af9f93 (diff)
downloadNim-4fc7fcb775140dc774a713063917fbf7d1392bdf.tar.gz
`--hintAsError` (#16763)
* --hintAsError

* add test, changelog

* condsyms
Diffstat (limited to 'compiler/msgs.nim')
-rw-r--r--compiler/msgs.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index afb51da09..442695ea1 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -413,7 +413,7 @@ proc handleError(conf: ConfigRef; msg: TMsgKind, eh: TErrorHandling, s: string)
     if conf.cmd == cmdIdeTools: log(s)
     quit(conf, msg)
   if msg >= errMin and msg <= errMax or
-      (msg in warnMin..warnMax and msg in conf.warningAsErrors):
+      (msg in warnMin..hintMax and msg in conf.warningAsErrors):
     inc(conf.errorCounter)
     conf.exitcode = 1'i8
     if conf.errorCounter >= conf.errorMax:
@@ -522,7 +522,11 @@ proc liMessage*(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg: string,
   of hintMin..hintMax:
     sev = Severity.Hint
     ignoreMsg = not conf.hasHint(msg)
-    title = HintTitle
+    if msg in conf.warningAsErrors:
+      ignoreMsg = false
+      title = ErrorTitle
+    else:
+      title = HintTitle
     color = HintColor
     inc(conf.hintCounter)