Bug 5839 – Spellchecker matches private symbols outside of the module, leading to extra, broken error messages

Status
RESOLVED
Resolution
DUPLICATE
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-04-12T18:21:06Z
Last change time
2020-09-06T22:14:25Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-04-12T18:21:06Z
D2 program: import std.random; void main() { int[int] aa; aa[seep] ~= 0; } DMD 2.052 shows an error without line number: test.d: Error: module test std.random.seed is private test.d(4): Error: undefined identifier seep, did you mean variable seed? Marked as critical because Don asked me to do this in a comment of bug 5745
Comment #1 by smjg — 2011-04-21T14:02:45Z
That error message shouldn't be there at all. The only output it should give is test.d(4): Error: undefined identifier seep
Comment #2 by kennytm — 2011-05-08T13:31:38Z
*** Issue 5961 has been marked as a duplicate of this issue. ***
Comment #3 by bugzilla — 2012-01-20T20:47:55Z
Now it gives: foo.d(4): Error: undefined identifier seep
Comment #4 by andrej.mitrovich — 2012-12-22T12:28:31Z
*** Issue 9196 has been marked as a duplicate of this issue. ***
Comment #5 by andrej.mitrovich — 2012-12-22T12:30:37Z
(In reply to comment #3) > Now it gives: > > foo.d(4): Error: undefined identifier seep This still hasn't fixed the root issue, the problem is in the spellchecker and the OP sample is just one of many examples which triggers the problem.
Comment #6 by andrej.mitrovich — 2012-12-22T12:32:02Z
*** Issue 9196 has been marked as a duplicate of this issue. ***
Comment #7 by andrej.mitrovich — 2012-12-22T12:32:53Z
(In reply to comment #5) > (In reply to comment #3) > > Now it gives: > > > > foo.d(4): Error: undefined identifier seep > > This still hasn't fixed the root issue, the problem is in the spellchecker and > the OP sample is just one of many examples which triggers the problem. Sample in git-head from http://d.puremagic.com/issues/show_bug.cgi?id=9196: import std.typetuple; void fn() { genericReplace(0, 0, 3); } There are many many more examples, and there are probably other dupe reports opened on issues like this.
Comment #8 by andrej.mitrovich — 2013-02-15T18:17:35Z
Comment #9 by yebblies — 2013-08-04T05:07:35Z
*** Issue 10140 has been marked as a duplicate of this issue. ***
Comment #10 by r.sagitario — 2014-11-19T08:47:43Z
Comment #11 by andrej.mitrovich — 2015-10-11T11:40:01Z
(In reply to Rainer Schuetze from comment #10) > This should be fixed as part of > https://github.com/D-Programming-Language/dmd/pull/4143 Seems like this may have fixed it. Reopen if another case pops up.
Comment #12 by b2.temp — 2020-01-11T07:47:00Z
new case: a.d --- module a; class Foo { private int x; } --- b.d --- module b; import a; void test(Foo foo) { foo.x++; } --- dmd a.d b.d > b.d(7): Error: no property x for type a.Foo, did you mean a.Foo.x? I would have expected a message related to the visibility.
Comment #13 by b2.temp — 2020-01-26T18:32:19Z
*** Issue 20531 has been marked as a duplicate of this issue. ***
Comment #14 by b2.temp — 2020-03-05T10:56:18Z
*** Issue 20637 has been marked as a duplicate of this issue. ***
Comment #15 by pro.mathias.lang — 2020-09-06T22:14:25Z
Now duplicate of 20637 which was fixed as part of v2.092.0. I checked that Basile's comment (c12) does indeed work as it should. *** This issue has been marked as a duplicate of issue 20637 ***