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


kenn...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Other                       |All
            Version|unspecified                 |D2
         OS/Version|Windows                     |All


--- Comment #1 from kenn...@gmail.com 2011-07-22 04:07:10 PDT ---
I believe the previous versions are accept-invalid. The leading 'const' is
equivalent to the trailing 'const', which is applying the 'const' to 'this'
only. Therefore, the function's type is in fact

    ref int get() const;

If you want to return a const int, apply it directly on the return type.

------------------
struct foo
{
  public:
    ref const(int) get() const { return bar[0]; }
  //    ^^^^^^^^^^
  private:
    int bar[1];
}

void main(){
 auto a = foo();
}
------------------

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

Reply via email to