// file c/b.d
module c.b;
public void aPublicFunction() {}
package void aPackageFunction() {}
// file a.d
module a;
public import c.b;
// file main.d
import a;
void main()
{
aPublicFunction();
aPrivateFunction();
}
dmd main.d a.d c/b.d
main.d(7): Deprecation: c.b.aPackageFunction is not visible from module main
main.d(7): Error: function c.b.aPackageFunction is not accessible from module main
The compiler emits 2 messages instead of just 1.
Comment #1 by slavo5150 — 2018-12-10T03:36:18Z
The example in the previous comment was supposed to be:
// file c/b.d
module c.b;
public void aPublicFunction() {}
package void aPackageFunction() {}
// file a.d
module a;
public import c.b;
// file main.d
import a;
void main()
{
aPublicFunction();
aPackageFunction(); // Typo: Private instead of Package
}
Anyway, this works fine if compiling with `-transition=import`. I don't know
Comment #2 by slavo5150 — 2018-12-10T03:38:37Z
`-transtion=import` was implemented with the fix for issue 10378.
I don't know if the compiler is transitioning to the behavior of the current compiler implementation, or transitioning away from the current implementation to the behavior in `-transition=import`.