www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5969] New: Poor error message for foreach over type tuple

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5969

           Summary: Poor error message for foreach over type tuple
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



This code fails with a back-end error:
test.d(7): Error: type Foo is not an expression

struct Foo {
    int a;
}
int foo()
{
    foreach (f; Foo.tupleof)
    {}
    return 1;
}
//static assert(foo());
It should be a front-end error. If you uncomment the static assert, you get a
cryptic "cannot interpret Foo at compile time" error.
But the error should have been detected before CTFE was initiated.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 09 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5969


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |andrej.mitrovich gmail.com
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com



21:49:39 PST ---
https://github.com/D-Programming-Language/dmd/pull/1516

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