Skip to content

Commit 234f4a2

Browse files
Danil Yarantsevnarimiran
authored andcommitted
Change severity of template instantiation message [backport] (#14526)
* Change severity of template instatiation msg * Add a test * Trailing newline argh (cherry picked from commit 3698f19)
1 parent c7cf5d4 commit 234f4a2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

compiler/msgs.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ proc writeContext(conf: ConfigRef; lastinfo: TLineInfo) =
380380
if context.info != lastinfo and context.info != info:
381381
if conf.structuredErrorHook != nil:
382382
conf.structuredErrorHook(conf, context.info, instantiationFrom,
383-
Severity.Error)
383+
Severity.Hint)
384384
else:
385385
let message = if context.detail == "":
386386
instantiationFrom

nimsuggest/tests/ttempl_inst.nim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
template foo() =
2+
{.warning: "foo".}
3+
4+
foo()
5+
6+
#[!]#
7+
discard """
8+
$nimsuggest --tester $file
9+
>chk $1
10+
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"ttempl_inst [Processing]";;0
11+
chk;;skUnknown;;;;Hint;;$file;;4;;3;;"template/generic instantiation from here";;0
12+
chk;;skUnknown;;;;Warning;;$file;;2;;11;;"foo [User]";;0
13+
"""

0 commit comments

Comments
 (0)