compiler/semcall: return the correct lineinfo for nkCallStrLit (#12484)

This commit is contained in:
alaviss 2019-10-24 16:21:37 +00:00 • committed by Andreas Rumpf
commit f827d75804
2 changed files with 13 additions and 1 deletions

View file

@ -474,7 +474,8 @@ proc updateDefaultParams(call: PNode) =
proc getCallLineInfo(n: PNode): TLineInfo = proc getCallLineInfo(n: PNode): TLineInfo =
case n.kind case n.kind
of nkAccQuoted, nkBracketExpr, nkCall, nkCommand: getCallLineInfo(n.sons[0]) of nkAccQuoted, nkBracketExpr, nkCall, nkCallStrLit, nkCommand:
getCallLineInfo(n.sons[0])
of nkDotExpr: getCallLineInfo(n.sons[1]) of nkDotExpr: getCallLineInfo(n.sons[1])
else: n.info else: n.info

View file

@ -0,0 +1,11 @@
func foo(s: string) = discard
foo"string"#[!]#
discard """
$nimsuggest --tester $file
>highlight $1
highlight;;skFunc;;1;;5;;3
highlight;;skType;;1;;12;;6
highlight;;skFunc;;3;;0;;3
"""