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

           Summary: Possible to return const object through mutable Object
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: d...@me.com


--- Comment #0 from Jacob Carlborg <d...@me.com> 2012-04-15 23:20:04 PDT ---
class Foo
{
    Foo f;

    Foo bar () const
    {
        return f;
    }
}

The above code results in the compile error:

Error: cannot implicitly convert expression (this.f) of type const(Foo) to
test.Foo

This is just as expected, but if I change "bar" to:

Object bar () const
{
    return f;
}

I don't get any errors.

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

Reply via email to