www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11256] New: Error mixing struct with disabled default construction and templated with lambda struct

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg 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: -------
Oct 14 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11256


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-10-14 09:49:23 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2666

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11256



--- Comment #2 from github-bugzilla puremagic.com 2013-10-14 12:39:17 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fbfb7ca42e02243f6517dc17925fd99af60cbd32
fix Issue 11256 - Error mixing struct with disabled default construction and
templated with lambda struct

https://github.com/D-Programming-Language/dmd/commit/02c41d3131d56f5073d1c5017a8ee0362ef7588a
Fix ICE case 1 in issue 11256

https://github.com/D-Programming-Language/dmd/commit/3a7b56d0e6fe8d8ff4c44c0c143b4556e4069067
Fix ICE case 2 in issue 11256

https://github.com/D-Programming-Language/dmd/commit/4a2fabf1d4b9fbeda49187ecce5ebaeba79dc5a4
Merge pull request #2666 from 9rnsr/fix11256

[REG2.063] Issue 11256 - Error mixing struct with disabled default construction
and templated with lambda struct

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11256



--- Comment #3 from github-bugzilla puremagic.com 2013-10-14 12:39:44 PDT ---
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bafe0cbda4d6da9efae971b6496791e07ceb5215
Merge pull request #2666 from 9rnsr/fix11256

[REG2.063] Issue 11256 - Error mixing struct with disabled default construction
and templated with lambda struct

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11256


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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