Skip to content

Commit

Permalink
Change severity of template instantiation message [backport] (#14526)
Browse files Browse the repository at this point in the history
* Change severity of template instatiation msg

* Add a test

* Trailing newline argh

(cherry picked from commit 3698f19)
  • Loading branch information
Danil Yarantsev authored and narimiran committed Jun 8, 2020
1 parent c7cf5d4 commit 234f4a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/msgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ proc writeContext(conf: ConfigRef; lastinfo: TLineInfo) =
if context.info != lastinfo and context.info != info:
if conf.structuredErrorHook != nil:
conf.structuredErrorHook(conf, context.info, instantiationFrom,
Severity.Error)
Severity.Hint)
else:
let message = if context.detail == "":
instantiationFrom
Expand Down
13 changes: 13 additions & 0 deletions nimsuggest/tests/ttempl_inst.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
template foo() =
{.warning: "foo".}

foo()

#[!]#
discard """
$nimsuggest --tester $file
>chk $1
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"ttempl_inst [Processing]";;0
chk;;skUnknown;;;;Hint;;$file;;4;;3;;"template/generic instantiation from here";;0
chk;;skUnknown;;;;Warning;;$file;;2;;11;;"foo [User]";;0
"""

0 comments on commit 234f4a2

Please sign in to comment.