[Issue 10456] New: struct containing enum X, alias X this and a dynamic array no longer compiles since 2.063

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 23 17:09:21 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10456

           Summary: struct containing enum X, alias X this and a dynamic
                    array no longer compiles since 2.063
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: gassa at mail.ru


--- Comment #0 from Ivan Kazmenko <gassa at mail.ru> 2013-06-23 17:09:20 PDT ---
I have reduced my problematic code to this:

-----
struct TheStruct
{
    enum TheEnum {ELEMENT};
    alias TheEnum this;
    int [] x;
}
-----

It produces the following errors:

-----
Error: type TheEnum is not an expression
Error: type TheEnum is not an expression
-----

Notes:
1. Compiles fine with DMD 2.062. Gives the errors with 2.063 and 2.063.2.
2. It does print the error twice.
3. No file or line number in the message complicates debugging.
4. "int [] x" cannot be further reduced to "int x". Seems it has to be a
dynamic array (of anything), associative array, a class or struct containing
such an array, or something similar to produce the error. If TheStruct is a
class instead of a struct, the error also vanishes in my case.

Ivan Kazmenko.

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


More information about the Digitalmars-d-bugs mailing list