D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1941 - missing line on inaccesable external private module member
Summary: missing line on inaccesable external private module member
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 critical
Assignee: No Owner
URL:
Keywords: diagnostic, patch
Depends on:
Blocks:
 
Reported: 2008-03-25 12:14 UTC by Stephan Dilly
Modified: 2015-06-09 01:20 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Dilly 2008-03-25 12:14:39 UTC
[mod.d]
module mod;

private int bar;

[main.d]
module main;

import mod;

void main(){bar = 0;}

gives dmd compiler output:
"main.d: module main mod.bar is private"

this message must be improved. it should at least provide a line number to be parsable as every other error message (every other besides the other ones that are broke ;)
Comment 1 Justin C Calvarese 2008-03-25 13:28:17 UTC
I don't know how the compiler works, but here's my guess on the source of the problem (and its solution).

src\dmd\dsymbol.c, line 667 (DMD 1.028):
		error("%s is private", d->toPrettyChars());
should be:
		error(loc, "%s is private", d->toPrettyChars());
Comment 2 Don 2008-07-09 07:12:50 UTC
Fixed DMD1.032
Comment 3 Stephan Dilly 2008-08-10 06:08:21 UTC
I dont know if it was fixed in the previous version but i know for sure it is still the same bug in 2.018, so i reopen it.
Comment 4 Don 2010-05-17 08:19:32 UTC
This has actually never worked on any version of DMD. Downgrading to critical. The patch still works, though (it is line 847 of dsymbol.c in DMD2.047.
Comment 5 Walter Bright 2010-05-31 22:48:30 UTC
http://www.dsource.org/projects/dmd/changeset/510