[Issue 8289] New: Cannot declare functions returning anonymous enum if they have 'in' block.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 23 07:09:26 PDT 2012


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

           Summary: Cannot declare functions returning anonymous enum if
                    they have 'in' block.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mp81ss at rambler.ru


--- Comment #0 from Michele Pes <mp81ss at rambler.ru> 2012-06-23 07:11:50 PDT ---
import std.stdio;

enum { A, B };

/*
If I replace the return type int with enum, doesn't compile.
If I remove the in/body blocks and declare a contractless f, both enum/int are
ok.
*/
int dummy(in int i)
in {
    assert(i > 0);
}
body {
    return A;
}

void main()
{
    immutable x = dummy(0);
}

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