Bug 19673 – __traits(getProtection) Cannot read the protection level of interface members

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-02-13T01:51:40Z
Last change time
2024-12-13T19:02:26Z
Assigned to
No Owner
Creator
Adam Wilson
Moved to GitHub: dmd#19539 →

Comments

Comment #0 by flyboynw — 2019-02-13T01:51:40Z
Consider the following code: module mod1; public Interface I { public int method(); } ----- module mod2; import mod1; void main() { auto protection = __traits(getProtection, I.method); //Compiler error } This could be a bug in a number of a different ways. 1: __traits(getProtection) should be able to read interface member protection levels. 2: Interfaces are incorrectly allowed by the compiler. 3: The specification should annotate that protection levels are allowed on interface members.
Comment #1 by flyboynw — 2019-02-13T01:56:20Z
Correction: Interface protection levels are incorrectly allowed by compiler.
Comment #2 by robert.schadek — 2024-12-13T19:02:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19539 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB