Bug 10342 – Error spew from specific compile order

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-12T02:57:49Z
Last change time
2018-01-08T13:30:36Z
Assigned to
No Owner
Creator
Peter Alexander

Comments

Comment #0 by peter.alexander.au — 2013-06-12T02:57:49Z
The following test case results in an unnecessary spew of invalid errors. ---- a.d ---- void main() { x; } ---- b.d ---- import std.stdio; ---- c.d ---- import std.stdio; immutable ushort p; void foo() { writefln("%d", p); } ---- Compile with ---- dmd a.d b.d c.d ---- Output ---- a.d(1): Error: undefined identifier x, did you mean module a? std/format.d(1205): Error: cannot implicitly convert expression (obj) of type immutable(ushort) to immutable(bool) std/format.d(2950): Error: template instance std.format.formatValue!(LockingTextWriter, immutable(ushort), char) error instantiating ... lots more similar nonsense errors ... NOTES: - The file order in the compile is important, compiling c.d before b.d removes the issue - Yes, the b.d file is necessary to repro Expected behaviour: only the first line of the output should be presented (undefined identifier x)
Comment #1 by razvan.nitu1305 — 2018-01-08T13:30:36Z
Running the test case on git HEAD Ubuntu 16.04 results in successful compilation. Closing as WORKSFORME. Please reopen if I am missing something.