digitalmars.D - Incorrect ParameterIdentifierTuple results?
- John Chapman (13/13) Nov 30 2018 ParameterIdentifierTuple produces different results depending on
- Neia Neutuladh (3/7) Nov 30 2018 Compiler and version would be helpful here.
- John Chapman (11/14) Nov 30 2018 Hmm, I was calling ParameterIdentifierTuple inside a lambda -
- John Chapman (4/20) Nov 30 2018 On Friday, 30 November 2018 at 19:37:52 UTC, John Chapman wrote:
ParameterIdentifierTuple produces different results depending on whether unnamed parameters are built-in types or user types. struct SomeType { void wrong(SomeType) {} void right(int) {} } ParameterIdentifierTuple!(__traits(getMember, SomeType, "wrong")); // tuple("SomeType") ParameterIdentifierTuple!(__traits(getMember, SomeType, "right")); // tuple("") Is this the intended behaviour? Shouldn't it just return empty strings in both cases? What would be the benefit of returning user type names?
Nov 30 2018
On Fri, 30 Nov 2018 18:18:36 +0000, John Chapman wrote:ParameterIdentifierTuple!(__traits(getMember, SomeType, "wrong")); // tuple("SomeType") ParameterIdentifierTuple!(__traits(getMember, SomeType, "right")); // tuple("")Compiler and version would be helpful here. I'm on DMD 2.081.1 and it yields the same results in each case: _param_0
Nov 30 2018
On Friday, 30 November 2018 at 19:07:14 UTC, Neia Neutuladh wrote:Compiler and version would be helpful here. I'm on DMD 2.081.1 and it yields the same results in each case: _param_0Hmm, I was calling ParameterIdentifierTuple inside a lambda - once I moved it into my main function I got the same output as you. But … change SomeType to an interface and it reproduces the issue I reported above. interface SomeType { void wrong(SomeType); void right(int); } I'm on DMD 2.083.0.
Nov 30 2018
On Friday, 30 November 2018 at 19:37:52 UTC, John Chapman wrote:On Friday, 30 November 2018 at 19:07:14 UTC, Neia Neutuladh wrote:On Friday, 30 November 2018 at 19:37:52 UTC, John Chapman wrote: This is pretty broken so I've opened a bug: https://issues.dlang.org/show_bug.cgi?id=19456Compiler and version would be helpful here. I'm on DMD 2.081.1 and it yields the same results in each case: _param_0Hmm, I was calling ParameterIdentifierTuple inside a lambda - once I moved it into my main function I got the same output as you. But … change SomeType to an interface and it reproduces the issue I reported above. interface SomeType { void wrong(SomeType); void right(int); } I'm on DMD 2.083.0.
Nov 30 2018