Bug 19471 – Duplicate error messages when trying to use an inaccessible package symbol

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-12-09T22:35:25Z
Last change time
2024-12-13T19:01:33Z
Assigned to
No Owner
Creator
Mike Franklin
See also
https://issues.dlang.org/show_bug.cgi?id=19014, https://issues.dlang.org/show_bug.cgi?id=10378
Moved to GitHub: dmd#19515 →

Comments

Comment #0 by slavo5150 — 2018-12-09T22:35:25Z
// 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`.
Comment #3 by slavo5150 — 2018-12-10T07:57:05Z
This should be resolved whenever the visibility and lookup deprecations are removed. https://github.com/dlang/dmd/pull/9058 https://github.com/dlang/dmd/pull/7241
Comment #4 by robert.schadek — 2024-12-13T19:01:33Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19515 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB