Skip to content

fix: implicit imports drop std/ prefix#25780

Open
Graveflo wants to merge 2 commits intonim-lang:develfrom
Graveflo:importstdpref
Open

fix: implicit imports drop std/ prefix#25780
Graveflo wants to merge 2 commits intonim-lang:develfrom
Graveflo:importstdpref

Conversation

@Graveflo
Copy link
Copy Markdown
Contributor

@Graveflo Graveflo commented Apr 30, 2026

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]

@Araq
Copy link
Copy Markdown
Member

Araq commented Apr 30, 2026

Windows specific:

Category: compiler
Name: tests/compiler/tcmdline_import_std_prefix.nim c -d:nimPreviewSlimSystem --warning:StdPrefix:on --warningAsError:StdPrefix:on --import:std/objectdollar
Action: run
Result: reNimcCrash
-------- Expected -------

--------- Given --------
$ D:\a\1\s\bin\nim.exe c --hints:on -d:testing --nimblePath:build/deps/pkgs2 --nimCache:nimcache\tests\compiler\tcmdline_import_std_prefix.nim_4a8a08f09d37b73795649038408b5f33 -d:nimPreviewSlimSystem --warning:StdPrefix:on --warningAsError:StdPrefix:on --import:std/objectdollar tests\compiler\tcmdline_import_std_prefix.nim
Hint: used config file 'D:\a\1\s\config\nim.cfg' [Conf]
Hint: used config file 'D:\a\1\s\config\config.nims' [Conf]
Hint: used config file 'D:\a\1\s\tests\config.nims' [Conf]
Hint: used config file 'D:\a\1\s\tests\compiler\nim.cfg' [Conf]
tcmdline_import_std_prefix.nim(1, 2) Error: objectdollar needs the 'std' prefix [StdPrefix]


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants