www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4706] New: Overloading auto return w/ non-auto return = strange error msg

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4706

           Summary: Overloading auto return w/ non-auto return = strange
                    error msg
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2010-08-21 12:24:22 PDT ---
struct Foo(T) {
     property auto ref front() {
        return T.init;
    }

     property void front(T num) {}
}

void main() {
    Foo!int foo;
    auto a = foo.front;
    foo.front = 2;
}

test9.d(6): Error: cannot overload both property and non-property functions
test9.d(6): Error: cannot overload both property and non-property functions

Strangely enough, changing the setter overload to the following fixes the
problem:

 property auto front(T num) {}

Marking this one as minor because it's trivial to work around and hard to
trigger.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 21 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4706


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2011-06-23
12:08:10 PDT ---
https://github.com/D-Programming-Language/dmd/commit/6a15077f8189e1ef203565edaebc766446aa105b

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