[Issue 23916] Non-eponymous template instances have a "type" (void)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 13 13:00:07 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23916

--- Comment #6 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to Nick Treleaven from comment #5)
> It checks if `a` has a type. It tells the reader that `a` is not a module or
> a type itself.

Am I missing something? How does it tell that to the reader, unless the reader
is aware of this weird quirk in the language? Wouldn't something more explicit
be much better?

What is the real use case? Do you have any real-world code which illustrates
why this rule in the language is useful?

> Why is it a problem if a template instance has a type?

It allows (accidentally, or maliciously) writing working but confusing code,
and allows accidentally writing non-working code which is difficult to diagnose
why it's not working.

--


More information about the Digitalmars-d-bugs mailing list