Jump to page: 1 2
Thread overview
[Issue 4329] New: Do not show errors that refer to __error
Jun 16, 2010
nfxjfg@gmail.com
[Issue 4329] Do not show error messages that refer to __error
Jun 16, 2010
Don
Jun 17, 2010
nfxjfg@gmail.com
Jun 17, 2010
Leandro Lucarella
Jun 17, 2010
Leandro Lucarella
Jun 17, 2010
nfxjfg@gmail.com
Jun 17, 2010
Don
Jun 18, 2010
Don
Aug 14, 2010
Leandro Lucarella
Nov 05, 2010
Don
Jan 07, 2011
nfxjfg@gmail.com
Jan 07, 2011
Brad Roberts
Feb 13, 2011
Don
Mar 02, 2011
Don
June 16, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4329

           Summary: Do not show errors that refer to __error
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: nfxjfg@gmail.com


--- Comment #0 from nfxjfg@gmail.com 2010-06-16 08:02:25 PDT ---
dmd should not output error messages like these:

Error: function expected before (), not __error of type TOK149

I have never seen an error message that refers to __error, and that I wanted to see. They don't add any additional value, and are only (by definition?) caused by preceding, actual errors. They are only noise and don't add any additional value.

-- 
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=4329


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2010-06-16 08:50:34 PDT ---
(In reply to comment #0)
> dmd should not output error messages like these:
> 
> Error: function expected before (), not __error of type TOK149
> 
> I have never seen an error message that refers to __error, and that I wanted to see. They don't add any additional value, and are only (by definition?) caused by preceding, actual errors. They are only noise and don't add any additional value.

__error is a new improvement to the compiler to supress spurious error messages. (in previous releases, it would have been 'int'). You should never see them. Please post any test cases which produce them.

-- 
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=4329



--- Comment #2 from nfxjfg@gmail.com 2010-06-17 02:58:53 PDT ---
Don, it seems to happen all the time. Normally I fix my compilation error right away, so I don't have a test case ready. See bug 4335 for one.

-- 
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=4329


Leandro Lucarella <llucax@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |llucax@gmail.com


--- Comment #3 from Leandro Lucarella <llucax@gmail.com> 2010-06-17 06:40:46 PDT ---
Copied from bug 4335 for convenience:

---
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_

(the first wrong error message is what bug 4335 is about)

-- 
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=4329



--- Comment #4 from Leandro Lucarella <llucax@gmail.com> 2010-06-17 06:41:48 PDT ---
BTW, note that this testcase is, unfortunately, D1 only.

-- 
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=4329



--- Comment #5 from nfxjfg@gmail.com 2010-06-17 07:15:10 PDT ---
It's possible that this is D1-only, I noticed the thing above only when working with D1 code.

-- 
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=4329



--- Comment #6 from Don <clugdbug@yahoo.com.au> 2010-06-17 12:38:17 PDT ---
Come on, fellas, you can do better than that. Here's 3 examples, and the last one produces a segfault.

void bug4329()
{
   with(great!().trepidation) return;
   try{
        throw CautionToTheWind;
    } catch(LifeThreatening illness){}
}

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



--- Comment #7 from Don <clugdbug@yahoo.com.au> 2010-06-18 01:28:49 PDT ---
And here are another seven cases I found.

TEST CASE B:
--------------
void bug4329b()
{
   create!().havoc!();
   delete something;
    mixin(chaos);
}
bug.d(25): Error: template instance template 'create' is not defined
bug.d(25): Error: undefined identifier create!().havoc
bug.d(25): Error: __error isn't a template
bug.d(26): Error: undefined identifier something
bug.d(26): Error: cannot delete type _error_
bug.d(27): Error: undefined identifier chaos
bug.d(27): Error: argument to mixin must be a string, not (__error)
bug.d(27): Error: argument to mixin must be a string, not (__error)

TEST CASE C:
--------------
void bug4329c()
{
    delete and!(crash);
}
bug.d(33): Error: identifier 'crash' is not defined
bug.d(33): Error: and!(_error_) is not an lvalue
bug.d(33): Error: cannot delete type void

TEST CASE D:
--------------
void bug4329d() {
    make!(mess);
    switch(2) {
        case 3:.. case 6.7:
        case closed:
    }
}
bug.d(37): Error: identifier 'mess' is not defined
bug.d(37): Error: make!(_error_) has no effect
bug.d(39): Error: cannot implicitly convert expression (6.7) of type double to
i
nt
bug.d(39): Error: first case 3 is greater than last case __error
bug.d(40): Error: undefined identifier closed
bug.d(40): Error: case must be a string or an integral constant, not __error

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


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #8 from bearophile_hugs@eml.cc 2010-07-03 11:03:58 PDT ---
This is a case I have found:

void main() {
    int[] a = cast(int[])array(iota(10));
}


dmd 2.047 prints:
temp.d(2): Error: undefined identifier array
temp.d(2): Error: undefined identifier iota
Error: cannot cast _error_ to int[]

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



--- Comment #9 from bearophile_hugs@eml.cc 2010-07-28 14:13:30 PDT ---
One case, dmd 2.047:

void main() {
    auto x = foo.bar!();
}

test.d(2): Error: undefined identifier foo
test.d(2): Error: __error isn't a template

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2