Unify the way anonymous class symbols are printed in error messages
This is slightly different from Strada in two ways:
GetNameOfDeclarationis preferred now(anonymous)becomes(Anonymous class)- which is just more consistent
I'm not 100% clear why (Anonymous class) is more consistent. The (Missing) change seems correct because it improves a baseline, but otherwise I'm not sure.
This isn't particularly consistent: TS playground. I am surprised now that the first error mentions (Missing) - I could swear I've seen (anonymous) there over the weekend :o But even considering that, this isn't really consistent
(Anonymous class) seems to be way more common in Strada. In its test suite, we can find that 700+ times whereas (anonymous) appears only 4 times (and all of those are within a single test case). (Missing) appears 100+ times but none of those refer to a missing class name.
Old PR, but it would be worth updating this PR I think, at least into a form that reduces baseline diffs. I'd rather that be the outcome.
@jakebailey done
Er, well sort of, but it's not reducing diffs, it's still changing the behavior.
It changes one diff and adds it to the accepted changes. I could port this faithfully (to print (anonymous) instead of (Missing)) but then that isn't exactly consistent with some of the other presented cases (IIRC). So I chose to just unify this here while addressing this baseline diff
Sure, I can port this to Strada
I created a PR porting this to Strada: https://github.com/microsoft/TypeScript/pull/61943 so I have reverted new tests etc from here given they will come to Corsa automatically once you bump the submodule after that port lands
I'd leave the tests here; it's fine for tests to be "duplicated" between the two temporarily. The names will not conflict.