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