www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24150] New: Wrong deprecation using typeof on a member is

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

          Issue ID: 24150
           Summary: Wrong deprecation using typeof on a member is private
                    from different module
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: apz28 hotmail.com

module bug2;

struct S
{
public:
    int pubInt;
     property int pubGet() { return 1; }

private:
    int priInt;
     property int priGet() { return 2; }
}


module bug;

import bug2;

void main(string[] argv)
{
    alias pubInt = __traits(getMember, S, "pubInt");
    pragma(msg, typeof(pubInt).stringof);

    alias pubGet = __traits(getMember, S, "pubGet");
    pragma(msg, typeof(pubGet).stringof);

    alias priInt = __traits(getMember, S, "priInt");
    pragma(msg, typeof(priInt).stringof);

    alias priGet = __traits(getMember, S, "priGet");
    pragma(msg, typeof(priGet).stringof);
}


--output as below
int
int
int
C:\Development\Projects\DLang\std\test\bug\bug.d(17): Deprecation: function
`bug2.S.priGet` of type ` property int()` is not accessible from module `bug`
int

--
Sep 18 2023