Bug 4335 – Wrong suggestion in error (import std.stdio for writeln)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2010-06-16T16:38:00Z
Last change time
2011-02-12T14:29:26Z
Keywords
diagnostic
Assigned to
nobody
Creator
leandro.lucarella
Depends on
4329

Comments

Comment #0 by leandro.lucarella — 2010-06-16T16:38:49Z
I accidentally compiled some trivial D2 code with D1 and got a bad suggestion from the compiler. Here is a trivial testcase: --- import std.stdio; void main() { writeln("bug"); } --- t.d(3): Error: 'writeln' is not defined, perhaps you need to import std.stdio; ? t.d(3): Error: function expected before (), not __error of type _error_ Both errors are really confusing. First, std.stdio is already imported (but D1 doesn't have writeln(), just writefln()). Then there is a crpyptic error about things that are not even present in the file.
Comment #1 by leandro.lucarella — 2010-06-16T16:39:55Z
BTW, using DMD 1.062. This should be a regression introduced by the suggestions feature added in DMD 1.061.
Comment #2 by nfxjfg — 2010-06-17T02:57:15Z
The second error is bug 4329.
Comment #3 by clugdbug — 2011-02-12T14:29:26Z
Fixed in DMD1.066.