Change severity of template instantiation message [backport] (#14526)
* Change severity of template instatiation msg * Add a test * Trailing newline argh
This commit is contained in:
parent
4bb301dbe2
commit
3698f197f1
2 changed files with 14 additions and 1 deletions
|
|
@ -421,7 +421,7 @@ proc writeContext(conf: ConfigRef; lastinfo: TLineInfo) =
|
||||||
if context.info != lastinfo and context.info != info:
|
if context.info != lastinfo and context.info != info:
|
||||||
if conf.structuredErrorHook != nil:
|
if conf.structuredErrorHook != nil:
|
||||||
conf.structuredErrorHook(conf, context.info, instantiationFrom,
|
conf.structuredErrorHook(conf, context.info, instantiationFrom,
|
||||||
Severity.Error)
|
Severity.Hint)
|
||||||
else:
|
else:
|
||||||
let message = if context.detail == "":
|
let message = if context.detail == "":
|
||||||
instantiationFrom
|
instantiationFrom
|
||||||
|
|
|
||||||
13
nimsuggest/tests/ttempl_inst.nim
Normal file
13
nimsuggest/tests/ttempl_inst.nim
Normal file
|
|
@ -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
|
||||||
|
"""
|
||||||
Loading…
Add table
Add a link
Reference in a new issue