[Issue 24150] New: Wrong deprecation using typeof on a member is private from different module
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 18 21:49:58 UTC 2023
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 at puremagic.com
Reporter: apz28 at 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
--
More information about the Digitalmars-d-bugs
mailing list