[Issue 7363] New: Eponymous Template doesn't hide internal names in some cases with `static if`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 24 13:43:07 PST 2012


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

           Summary: Eponymous Template doesn't hide internal names in some
                    cases with `static if`
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis <verylonglogin.reg at gmail.com> 2012-01-25 00:43:06 MSK ---
It still works sometimes so I decided not to reopen Issue 4675 but create a new
one. Testcases:
---
template t() {
    enum e = 0;
    static if (true)
        enum t = 0;
}

static assert(!__traits(compiles, t!().t == 0)); // Assertion fails
static assert(t!() == 0); // Error: void has no value
---
and
---
template t()
{
    static if (true) {
        enum e = 0;
        enum t1 = 0;
    }
    alias t1 t;
}

static assert(!__traits(compiles, t!().t == 0)); // Assertion fails
static assert(t!() == 0); // Error: void has no value
---

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