[Issue 3563] New: Enum values returned by ref from a function trigger compiler error.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 1 15:19:16 PST 2009


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

           Summary: Enum values returned by ref from a function trigger
                    compiler error.
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: e.insafutdinov at gmail.com


--- Comment #0 from Eldar Insafutdinov <e.insafutdinov at gmail.com> 2009-12-01 15:19:15 PST ---
The following code:

enum Foo { A, B }

Foo x = Foo.A;

ref Foo bar()
{
    return x;
}

ref const(Foo) baz()
{
    return bar();
}

results in compiler error:

bug.d(12): Error: bar() is not mutable


If you replace Foo with int - the bug disappears.

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