Bug 5621 – speller.c: implement type inference in speller suggestion

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-02-20T08:29:52Z
Last change time
2024-12-13T17:54:50Z
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#18330 →

Comments

Comment #0 by ibuclaw — 2011-02-20T08:29:52Z
The current implementation of the spell checker (as far as I can tell) always finds the nearest match to the incorrectly spelled symbol. So the following example: struct S2 {} struct S10 {} void main() { S10 a = S(); } Will emit the error: spell.d(6): Error: undefined identifier S, did you mean struct S2? Whereas it would be an improvement in these cases if it were to suggest the lhs type instead. Regards
Comment #1 by bugzilla — 2011-03-03T16:08:00Z
Implementing this would be difficult as it requires top-down type inference, whereas the semantic analysis is all done bottom-up.
Comment #2 by ibuclaw — 2013-11-17T07:00:20Z
*** Issue 10241 has been marked as a duplicate of this issue. ***
Comment #3 by ibuclaw — 2018-01-25T18:06:36Z
Maybe this was fixed by https://github.com/dlang/dmd/pull/4143 The compiler no longer offers spelling suggestion for the original test case.
Comment #4 by ibuclaw — 2018-01-25T18:07:30Z
It would still be a nice-to-have a type inference suggestion, instead of "undefined identifier 'S'"
Comment #5 by robert.schadek — 2024-12-13T17:54:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18330 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB