June 03, 2022
https://issues.dlang.org/show_bug.cgi?id=23152

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
I, personally, find that the "is used as a type error" is actually misleading in this context. S1 is a type, the problem is that the variable should have a different name. The "circular reference to variable S1" is also annoying, but I think it's closer to the truth since you are actually creating a circular reference.

Ideally, the error message should be: "variable name S1 conflicts with struct declaration S1". Also, it seems that:

void fun()
{
    S1 S1;
}

compiles just fine. Which should not.

--
December 28, 2022
https://issues.dlang.org/show_bug.cgi?id=23152

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Looks like https://github.com/dlang/dmd/pull/5588 introduced the loss of "S2 is used as a type" diagnostic.


In particular this change switched the result of resolving the identifier from an error expression to an error type (the latter doesn't have a "used as a type" follow-up error).

https://github.com/dlang/dmd/pull/5588/files#diff-17f8386682e9c4681f8080c09449e8db528014e83496ce7ed72fc82001fd0883R7455-R7460

--