[Issue 19673] New: __traits(getProtection) Cannot read the protection level of interface members

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 13 01:51:40 UTC 2019


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

          Issue ID: 19673
           Summary: __traits(getProtection) Cannot read the protection
                    level of interface members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: flyboynw at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list