www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5933] New: Cannot retrieve the return type of an auto-return member function

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

           Summary: Cannot retrieve the return type of an auto-return
                    member function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kennytm gmail.com



Test case:

------------------------------
struct X {
    auto x() {
        return 0; 
    }
}
pragma(msg, typeof(X.init.x));
static assert(is(typeof(&X.init.x) == int delegate()));
------------------------------
()
x.d(7): Error: static assert  (is(typeof(__error) == int delegate())) is false
------------------------------

The expected output is 'int()' and the static assert should pass. The '__error'
comes out because DMD thinks X.init.x is forward-referenced.




This also causes a ICE when using with std.traits.ReturnType:

------------------------------
struct X {
    auto x() {
        return 0; 
    }
}
static if (is(typeof(X.init.x) R == return)) {}
------------------------------
Assertion failed: (type), function AliasDeclaration, file declaration.c, line
376.
Abort trap
------------------------------

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 06 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Platform|Other                       |All
         OS/Version|Mac OS X                    |All



https://github.com/D-Programming-Language/dmd/pull/535

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 25 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert octarineparrot.com



13:26:15 GMT ---
Is http://d.puremagic.com/issues/show_bug.cgi?id=7159 the same issue as this?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thelastmammoth gmail.com



*** Issue 8653 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 15 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/5fa49c163dd294944c834e95676b9e71ed22ee82
fix Issue 5933 - Cannot retrieve the return type of an auto-return member
function

https://github.com/D-Programming-Language/dmd/commit/2ba68e1db6cf3b2d19dfe4d3f7909ee67948bad3


Issue 5933 & 7159 - Resolve forward reference to auto-return member function

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |pull




 https://github.com/D-Programming-Language/dmd/pull/535
That was a wrong change, and it had been reverted. A new pull request is: https://github.com/D-Programming-Language/dmd/pull/1543 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 23 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5933


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/960987479e5c591c19e2a49c729c98a7f1218bd5
fix Issue 5933 - Cannot retrieve the return type of an auto-return member
function

https://github.com/D-Programming-Language/dmd/commit/de4f8f6bf8dc9fcc1730ea4d7f2bbd3e74880f08


Issue 5933 & 7159 & 9377 - Invoke function semantic3 correctly where it is
required.

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