Thread overview
[Issue 4335] New: Wrong suggestion in error (import std.stdio for writeln)
Jun 16, 2010
Leandro Lucarella
Jun 16, 2010
Leandro Lucarella
Jun 17, 2010
nfxjfg@gmail.com
Feb 12, 2011
Don
June 16, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4335

           Summary: Wrong suggestion in error (import std.stdio for
                    writeln)
           Product: D
           Version: D1
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: llucax@gmail.com


--- Comment #0 from Leandro Lucarella <llucax@gmail.com> 2010-06-16 16:38:49 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 16, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4335



--- Comment #1 from Leandro Lucarella <llucax@gmail.com> 2010-06-16 16:39:55 PDT ---
BTW, using DMD 1.062. This should be a regression introduced by the suggestions feature added in DMD 1.061.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4335


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg@gmail.com
         Depends on|                            |4329


--- Comment #2 from nfxjfg@gmail.com 2010-06-17 02:57:15 PDT ---
The second error is bug 4329.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 12, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4335


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug@yahoo.com.au
         Resolution|                            |FIXED


--- Comment #3 from Don <clugdbug@yahoo.com.au> 2011-02-12 14:29:26 PST ---
Fixed in DMD1.066.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------