Thread overview
[Issue 23655] __traits(toType) shatters modularity
Jan 27, 2023
Max Samukha
Jan 27, 2023
Adam D. Ruppe
January 27, 2023
https://issues.dlang.org/show_bug.cgi?id=23655

Max Samukha <maxsamukha@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxsamukha@gmail.com

--- Comment #1 from Max Samukha <maxsamukha@gmail.com> ---
(In reply to Adam D. Ruppe from comment #0)

> 
> D has very few features that cross modules like this and they're bad to have. We should start removing these things, especially when they are unused and unnecessary, to remove potential for more serious order of eval bugs arising from them.

If the trait was properly designed, modularity would be trivially achieved by an implicit local import - "Error: cannot determine" is a lie because the mangled name contains the module information.

"toType" is a misnomer, though, as the trait should "just work" for any symbol.

--
January 27, 2023
https://issues.dlang.org/show_bug.cgi?id=23655

--- Comment #2 from Adam D. Ruppe <destructionator@gmail.com> ---
It should really just be removed from the language, as it serves no purpose and opens up a massive can of worms.

--
December 13
https://issues.dlang.org/show_bug.cgi?id=23655

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/20220

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--