[Issue 11822] New: `-de` switch causees ICE with `auto` return and other stuff

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 26 04:19:24 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11822

           Summary: `-de` switch causees ICE with `auto` return and other
                    stuff
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-12-26 16:19:22 MSK ---
This code should be rejected to compile with `-de` switch:
---
struct S(alias pred)
{
    this(int) { pred(1); }
    void f()  { pred(1); }
}

auto g(alias pred)()
{ return S!pred(1); }

deprecated bool d(int)
{ return true; }

auto h()
{
    int i;
    return g!(n => d(i))();
}
---
main.d(16): Deprecation: function main.d is deprecated
main.d(8):        instantiated from here: S!(__lambda1)
main.d(16):        instantiated from here: g!((n) => d(i))
main.d(16): Error: template instance main.h.g!((n) => d(i)) error instantiating
Assertion failure: 'type->ty == Tfunction' on line 3178 in file 'func.c'
---

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


More information about the Digitalmars-d-bugs mailing list