Files
Nim/tests/compiler/tcmdline_import_std_prefix.nim
Ryan McConnell 58043bb581 fix: implicit imports drop std/ prefix (#25780)
Preserves implicit imports instead of always storing the resolved
absolute filename. That lets the later StdPrefix warning check see the
original std/objectdollar spelling.

This is for situations where in cfg or cli warnings are enabled for the
prefix. Essentially a niche combination of compiler switches don't get
along e.g.

`-d:nimPreviewSlimSystem --warning:StdPrefix:on
--warningAsError:StdPrefix:on --import:std/objectdollar`

will cause:

`Error: objectdollar needs the 'std' prefix [StdPrefix]`

(cherry picked from commit 4c8052a45b)
2026-05-08 15:17:50 +02:00

11 lines
223 B
Nim

discard """
matrix: "-d:nimPreviewSlimSystem --warning:StdPrefix:on --warningAsError:StdPrefix:on --import:std/objectdollar"
output: "(a: 23, b: 45)"
"""
type Foo = object
a, b: int
let x = Foo(a: 23, b: 45)
echo x