www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9693] New: unclear scoping behaviour of declarations made in static if conditions

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

           Summary: unclear scoping behaviour of declarations made in
                    static if conditions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch


--- Comment #0 from timon.gehr gmx.ch 2013-03-11 17:14:31 PDT ---
With DMD 2.062, the following code compiles and runs:

void main() {
    int[string] x;
    static if (is(typeof(x) S : T[U], T, U)) { }
    pragma(msg, S, " ", T, " ", U);
}

This is not evident from the spec. The spec should clarify whether this is
supposed to compile or not. If it is not, the compiler implementation should be
fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 11 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9693



--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-03-11 22:40:19 PDT ---
I think this is definitely a bug. There is no usefulness.

Long time ago I found the bug, but I couldn't fix the bug.

As far as I know, std.typecons.Rebindable implementation is relied on this
buggy/bad feature.

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