www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14253] New: [REG2.067b3]

https://issues.dlang.org/show_bug.cgi?id=14253

          Issue ID: 14253
           Summary: [REG2.067b3] std.traits.ParameterStorageClassTuple
                    gives compiler errors when encountering 'return'
                    functions
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: opantm2+dbugs gmail.com

Code:
import std.traits;

struct Foo {
    ref Foo opAssign(ref Foo rhs) return { return this; }
}

void main() {
    alias tup = ParameterStorageClassTuple!(__traits(getOverloads, Foo,
"opAssign")[0]);
}

Output:
/Users/kapps/dev/dmd/phobos/std/traits.d(221): Error: key 'j' not found in
associative array ['a':cast(FunctionAttribute)1u,
'b':cast(FunctionAttribute)2u, 'c':cast(FunctionAttribute)4u,
'd':cast(FunctionAttribute)8u, 'e':cast(FunctionAttribute)16u,
'f':cast(FunctionAttribute)32u, 'i':cast(FunctionAttribute)64u]
/Users/kapps/dev/dmd/phobos/std/traits.d(970):        called from here:
demangleFunctionAttributes("NcNjKS4test3FooZS4test3Foo")
/Users/kapps/dev/dmd/phobos/std/traits.d(993):        while looking for match
for demangleNextParameter!(__error)
/Users/kapps/test.d(8): Error: template instance
std.traits.ParameterStorageClassTuple!(opAssign) error instantiating

--
Mar 06 2015