www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8595] New: typeof(return) inside opApply loop always int

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

           Summary: typeof(return) inside opApply loop always int
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



Probably related to the way opApply works under the hood, as a delegate that
returns int.

struct OpApply {
    int opApply(int delegate(ref int) dg) {
        assert(0);
    }
}

void main() {
    doIt();
}

string doIt() {
    foreach(elem; OpApply.init) {
        pragma(msg, typeof(return));  // int, should be string
    }

    assert(0);
}

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code



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

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




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

https://github.com/D-Programming-Language/dmd/commit/5a8204ff2342b854367ec7b582f90a203cd47545
fix Issue 8595 - typeof(return) inside opApply loop always int

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


Issue 8595 - typeof(return) inside opApply loop always int

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


Damian Ziemba <nazriel6969 gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |nazriel6969 gmail.com
         Resolution|                            |FIXED



PDT ---
Seems to be fixed with https://github.com/D-Programming-Language/dmd/pull/1097

Test case with newest DMD trunk:
http://dpaste.dzfl.pl/0a8d99b8

Closing issue if nobody minds :)

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