www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9967] New: ParameterIdentifierTuple broken for setters

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

           Summary: ParameterIdentifierTuple broken for setters
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: m.strashun gmail.com



http://dpaste.1azy.net/c246a5c7
---
import std.traits;

interface Test
{
     property void setter(int x);
}

pragma(msg, ParameterIdentifierTuple!(Test.setter));

void main()
{
}
---
Compilation output:
tuple("")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9967


Dicebot <m.strashun gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Phobos                      |DMD



Looks like not actually a phobos issue, but dmd/__parameters one:

http://dpaste.1azy.net/a09afb96
---
interface Test
{
     property void setter(int x);
}

alias Type = typeof(&(Test.setter));
pragma(msg, Type);

static if (is(Type PT == __parameters))
{
    pragma(msg, PT);
}
else
    pragma(msg, "Error!");

void main() {}
---
Compilation output:
void function(int x)  property
Error!
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9967


Sönke Ludwig <sludwig outerproduct.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sludwig outerproduct.org



PDT ---
__parameters seems to only with for actual function types and not for function
pointers. Replacing "alias Type = typeof(&Test.setter);" with "alias Type =
FunctionTypeOf!(Test.setter);" makes the bug example work. Similarly, replacing
the first static-if in ParameterIdentifierTuple makes it work, but I'm unsure
if this could break anything else:

line 832 traits.d:
--- static if (is(typeof!(func[0]) PT == __parameters))
+++ static if (is(FunctionTypeOf!(func[0]) PT == __parameters))

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




Oh, neat, I have thought & and FunctionTypeOf are quite equivalent.
It can be categorized as Phobos/ParameterIdentifierTuple issue then.

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


yazan.dabain gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yazan.dabain gmail.com



Pull request
https://github.com/D-Programming-Language/phobos/pull/1378

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9967




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

https://github.com/D-Programming-Language/phobos/commit/735d0e33c852fe691108c02241ba0129283f17cf


https://github.com/D-Programming-Language/phobos/commit/8c2f4c512fe7518acd92b78dace4141e9d618702




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9967


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
             Status|NEW                         |RESOLVED
          Component|DMD                         |Phobos
            Version|unspecified                 |D2
         Resolution|                            |FIXED


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