Bug 23938 – spellchecker suggests `~this()` but it cant be used.

Status
NEW
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-05-26T10:40:35Z
Last change time
2024-12-13T19:29:15Z
Keywords
diagnostic
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: dmd#20288 →

Comments

Comment #0 by b2.temp — 2023-05-26T10:40:35Z
for ``` void main() { class C { ~this(){} } (new C).dtor(); } ``` the spellchecker says : > /tmp/temp_7F7D4BFE0830.d:4:12: Error: no property `dtor` for type `temp_7F7D4BFE0830.main.C`, did you mean `temp_7F7D4BFE0830.main.C.~this`? But it should suggest `__dtor` instead
Comment #1 by razvan.nitu1305 — 2023-05-29T12:46:15Z
I think that this is a bit of a dilemma. __dtor is an internal symbol that should not reach the user facing surface. Also, calling dtor like this is ugly. However, I agree that suggesting a wrong method is worse. Maybe the compiler should suggest the druntime destroy function?
Comment #2 by dlang-bugzilla — 2023-06-03T20:55:27Z
It should just exempt special symbols from spell check suggestions. The spell checker can't know if the user actually meant to call the destructor.
Comment #3 by robert.schadek — 2024-12-13T19:29:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20288 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB