diff options
-rw-r--r-- | compiler/msgs.nim | 2 | ||||
-rw-r--r-- | nimsuggest/tests/ttempl_inst.nim | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim index c4658abcf..eca3b0276 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -421,7 +421,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 diff --git a/nimsuggest/tests/ttempl_inst.nim b/nimsuggest/tests/ttempl_inst.nim new file mode 100644 index 000000000..ed04a67ce --- /dev/null +++ b/nimsuggest/tests/ttempl_inst.nim @@ -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 +""" |