mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
Refs #24158 Fixes the line info of the module symbol (cases like `import as` and grouped imports had wrong line info). Since that symbol's line info is now used for the warnings, there isn't a separate line info stored for `unusedImports` Examples of fixed cases ```nim import strutils as test #[ ^ before ^ after ]# # This case was fixed by #24158, but only for unused imports import std/[strutils, strutils] #[ ^ before ^ after ]# from strutils import split #[ ^ before ^ after ]# ```
18 lines
826 B
Nim
18 lines
826 B
Nim
discard """
|
|
cmd: '''nim c --hint:Processing:off $file'''
|
|
action: compile
|
|
nimout: '''
|
|
tduplicate_imports.nim(12, 23) Hint: duplicate import of 'strutils'; previous import here: tduplicate_imports.nim(12, 13) [DuplicateModuleImport]
|
|
tduplicate_imports.nim(15, 20) Hint: duplicate import of 'foobar'; previous import here: tduplicate_imports.nim(14, 20) [DuplicateModuleImport]
|
|
tduplicate_imports.nim(16, 10) Hint: duplicate import of 'strutils'; previous import here: tduplicate_imports.nim(12, 23) [DuplicateModuleImport]
|
|
tduplicate_imports.nim(17, 8) Hint: duplicate import of 'strutils'; previous import here: tduplicate_imports.nim(16, 10) [DuplicateModuleImport]
|
|
'''
|
|
"""
|
|
|
|
import std/[strutils, strutils]
|
|
|
|
import strutils as foobar
|
|
import strutils as foobar
|
|
from std/strutils import split
|
|
import strutils except split
|