www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9153] New: Type inference for array of delegates should not break based on order

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

           Summary: Type inference for array of delegates should not break
                    based on order
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: hsteoh quickfur.ath.cx



import std.stdio;

version=Broken;

void main() {
        version(Broken) {
                auto tbl = [
                        (string x) { writeln(x); },
                        (string x) { x ~= 'a'; },
                ];
        } else {
                auto tbl = [
                        (string x) { x ~= 'a'; },
                        (string x) { writeln(x); },
                ];
        }
}

This code used to compile in dmd 2.058.

Commenting out "version=Broken" fixes the problem. It seems that type inference
isn't being done correctly for the delegates in the array, depending on what
order they appear in.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9153


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



https://github.com/D-Programming-Language/dmd/pull/1374

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 13 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9153




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3c81eff3ea8da324698ab05bf6fd5e105762414e
fix Issue 9153 - Type inference for array of delegates should not break based
on order

https://github.com/D-Programming-Language/dmd/commit/c9373834865ffe6a11e3bfae4c3507ee151cd0c0


Issue 9153 - Type inference for array of delegates should not break based on
order

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 17 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9153


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: -------
Dec 17 2012