You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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.
The text was updated successfully, but these errors were encountered:
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
`-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`.
This should be resolved whenever the visibility and lookup deprecations are removed.
https://github.com/dlang/dmd/pull/9058https://github.com/dlang/dmd/pull/7241
Mike Franklin reported this on 2018-12-09T22:35:25Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19471
Description
// 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.The text was updated successfully, but these errors were encountered: