www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21845] New: Wrong ParameterStorageClass when -preview=in is

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

          Issue ID: 21845
           Summary: Wrong ParameterStorageClass when -preview=in is used
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: omerfirmak gmail.com

When -preview=in causes a parameter to be passed by reference
ParameterStorageClassTuple reports the storage class as ref_ instead of in_.

----------------
import std;
struct Foo
{
        int a;
    double[100] b;
}
void func1 (in Foo foo);
void func2 (const ref Foo foo);
void main()
{
        writeln(ParameterStorageClassTuple!func1);
        writeln(ParameterStorageClassTuple!func2);
}
-------------

--
Apr 21