Thread overview
[Issue 8595] New: typeof(return) inside opApply loop always int
Aug 28, 2012
David Simcha
Aug 28, 2012
Kenji Hara
Sep 07, 2012
Damian Ziemba
August 28, 2012
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


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2012-08-28 09:08:52 PDT ---
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: -------
August 28, 2012
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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-08-28 10:04:28 PDT ---
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: -------
September 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8595



--- Comment #2 from github-bugzilla@puremagic.com 2012-09-06 00:23:03 PDT ---
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 Merge pull request #1097 from 9rnsr/fix8595

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: -------
September 07, 2012
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


--- Comment #3 from Damian Ziemba <nazriel6969@gmail.com> 2012-09-06 19:31:44 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: -------