[Issue 11256] New: Error mixing struct with disabled default construction and templated with lambda struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 03:25:59 PDT 2013


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

           Summary: Error mixing struct with disabled default construction
                    and templated with lambda struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice, rejects-valid
          Severity: regression
          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-10-14 14:25:57 MSD ---
---
struct S
{ @disable this(); }

struct Z(Ranges...)
{
    Ranges ranges; // line 6

    this(Ranges rs)
    { ranges = rs; }
}

struct F(alias pred)
{ this(int[] = null) { } }

Z!Ranges z(Ranges...)(Ranges ranges)
{ return Z!Ranges(ranges); } // line 16

void main()
{
    z(S.init, F!(gv => true)()); // line 20
}
---

Output:
---
main.d(16): Error: field Z!(S, F!((gv) => true))._ranges_field_0 must be
initialized because it has no default constructor
main.d(20): Error: template instance main.z!(S, F!((gv) => true)) error
instantiating
---

Output if line 6 is `Ranges ranges = Ranges.init;`:
---
Internal error: e2ir.c 5321
---

Output if line 6 is `Ranges ranges = void;`:
---
Assertion failure: 'v->type->ty == Tsarray && vsz == 0' on line 470 in file
'todt.c'
---

This causes e.g. error on `zip` over non-default constructable range and filter
result.

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