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


--- Comment #0 from Dicebot <m.strashun gmail.com> 2013-04-20 03:45:38 PDT ---
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


--- Comment #1 from Dicebot <m.strashun gmail.com> 2013-04-20 04:34:42 PDT ---
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


--- Comment #2 from Sönke Ludwig <sludwig outerproduct.org> 2013-04-29 02:55:41
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



--- Comment #3 from Dicebot <m.strashun gmail.com> 2013-04-29 03:07:32 PDT ---
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


--- Comment #4 from yazan.dabain gmail.com 2013-06-30 12:29:23 PDT ---
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



--- Comment #5 from github-bugzilla puremagic.com 2013-07-22 17:34:34 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/735d0e33c852fe691108c02241ba0129283f17cf
Fixes issue #9967 - ParameterIdentifierTuple broken for setters

https://github.com/D-Programming-Language/phobos/commit/8c2f4c512fe7518acd92b78dace4141e9d618702
Merge pull request #1378 from yazd/fix9967

Fix for issue #9967 - ParameterIdentifierTuple broken for setters

-- 
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