www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14947] New: std.traits: ParameterIdentifierTuple on an


          Issue ID: 14947
           Summary: std.traits: ParameterIdentifierTuple on an 'interface'
                    not working
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: s_dlang_bugzilla asylum.id.au

for dmd2.068, linux 64bit:

dmd -oftest test.d
(string, uint, bool)
tuple("a", "b", "c")
(string, uint, bool)
tuple("", "", "")

second tuple printout should be the same as the first one.

with test.d:
import std.traits;

interface IFoo { ulong foo_me(string a, uint b, bool c); }

class myFoo:IFoo{ ulong foo_me(string a, uint b, bool c){ return 42; } }

void main()
    auto tmp_foo = new myFoo;
    alias ParameterTypeTuple!(tmp_foo.foo_me) tmpfooTypes;
    alias ParameterIdentifierTuple!(tmp_foo.foo_me) tmpfooNames;

    foreach ( method; __traits(allMembers, IFoo))
        alias MemberFunctionsTuple!(IFoo, method) funcs;

        alias typeof(funcs[0]) func;
        alias ReturnType!func return_type;
        alias ParameterTypeTuple!func ParameterTypes;
        alias ParameterIdentifierTuple!func ParameterNames;


Aug 22 2015