Skip to content

Conversation

@weswigham
Copy link
Member

@weswigham weswigham commented May 14, 2024

These already will get errors in the checker when the file is typechecked, so the declaration emitter doesn't need to double up and also error on them.

This basically allows the declaration emitter to copy inputs with unresolvable names into the output without the output being blocked by a declaration-emitter issued error.

Fixes #58496
Fixes #58535

}
export type MyClass = typeof myClass;
~~~~~~~
!!! error TS4081: Exported type alias 'MyClass' has or is using private name 'myClass'.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declaration emit errors are emitted in the presence of parse errors (unlike checker errors), so this (pretty bogus, given the parse error) error was here before, and now it's gone. If checker errors were reported, there would be one on myClass here, but, again, blocked by a parse error anyway.

@weswigham weswigham merged commit 2d47953 into microsoft:main May 14, 2024
@weswigham weswigham deleted the declaration-emit-duplicated-errors branch May 14, 2024 19:49
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Backlog Bug PRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transpileDeclaration - Errors on unresolvable globals [transpileDeclaration API] What to do about "has or is using private name" diagnostics

3 participants