[Issue 7453] Can't return value from within opApply

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 20 01:36:27 PDT 2012


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


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

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


--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-04-20 01:37:22 PDT ---
Reduced test case:

struct S {
    int opApply(int delegate(string) dg) {
        return 0;
    }
}
void main() {
    foreach (_; S()) {
        return;
        // Error: long has no effect in expression (0)
        // test.d(8): Error: cannot return non-void from void function
    }
}

Pull request:
https://github.com/D-Programming-Language/dmd/pull/892

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