Bug 10241 – Probably wrong "did you mean" suggestion in error message
Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-02T05:48:00Z
Last change time
2013-11-17T07:00:19Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-06-02T05:48:49Z
import std.stdio;
void main() {
pre = 0;
}
Gives a strange error message, DMD 2.064alpha:
test.d(3): Error: undefined identifier pre, did you mean import core?
Comment #1 by yebblies — 2013-11-16T21:09:43Z
Issue 9644?
Comment #2 by bearophile_hugs — 2013-11-17T03:51:36Z
(In reply to comment #1)
> Issue 9644?
Probably it's another issue because "core" is not present in this program.
Comment #3 by yebblies — 2013-11-17T04:03:49Z
(In reply to comment #2)
> (In reply to comment #1)
> > Issue 9644?
>
> Probably it's another issue because "core" is not present in this program.
core is imported inside std.stdio, and is therefore visible.
Comment #4 by bearophile_hugs — 2013-11-17T05:40:41Z
*** This issue has been marked as a duplicate of issue 9644 ***
Comment #5 by bearophile_hugs — 2013-11-17T06:21:47Z
Reopened as fixing Issue 9644 has not fixed this.
Comment #6 by yebblies — 2013-11-17T06:24:59Z
(In reply to comment #5)
> Reopened as fixing Issue 9644 has not fixed this.
Again, do you expect to see here?
'core' is two letters away from 'pre'. Are you expecting no match? 'core' to be excluded? What?
Comment #7 by ibuclaw — 2013-11-17T06:46:54Z
(In reply to comment #6)
> (In reply to comment #5)
> > Reopened as fixing Issue 9644 has not fixed this.
>
> Again, do you expect to see here?
>
> 'core' is two letters away from 'pre'. Are you expecting no match? 'core' to
> be excluded? What?
I'd assume to be excluded, as the difference between 'pre' and 'import core' is quite a big one which we can safely ignore.
Comment #8 by yebblies — 2013-11-17T06:54:21Z
It's two letters from 'pre' to 'core'...
Currently the rule is maxdiff = min(len-1, 2)
What rule would you propose?
Comment #9 by ibuclaw — 2013-11-17T06:59:52Z
(In reply to comment #8)
> It's two letters from 'pre' to 'core'...
>
Now that you mention it, I can see it.
> Currently the rule is maxdiff = min(len-1, 2)
>
> What rule would you propose?
Something like the bug I'm going to link this against... which isn't simple to do in the current scheme of things.
Comment #10 by ibuclaw — 2013-11-17T07:00:19Z
*** This issue has been marked as a duplicate of issue 5621 ***