Make sure that field usage preserves the original line info (#19751)
Currently `struct.field` will generate a node with `info` that points to the symbol definition instead of having the actual node location.
This commit is contained in:
parent
8bfc396a4d
commit
e4a2c2d474
2 changed files with 17 additions and 0 deletions
15
nimsuggest/tests/tuse_structure.nim
Normal file
15
nimsuggest/tests/tuse_structure.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# tests for use and structures
|
||||
|
||||
type
|
||||
Foo* = ref object of RootObj
|
||||
bar*: string
|
||||
|
||||
proc test(f: Foo) =
|
||||
echo f.#[!]#bar
|
||||
|
||||
discard """
|
||||
$nimsuggest --tester $file
|
||||
>use $1
|
||||
def skField tuse_structure.Foo.bar string $file 5 4 "" 100
|
||||
use skField tuse_structure.Foo.bar string $file 8 9 "" 100
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue