Skip to content

Conversation

tobias-tengler
Copy link
Contributor

@tobias-tengler tobias-tengler commented Aug 8, 2023

Previously the compiler produced {} for empty objects in TypeScript. This is for example the case for the ...$variables type, if no variables are present.

The problem is that {} does not mean "empty object" in TypeScript. It means "any value except null and undefined".
Because of this you're able to input anything besides those two values as variables for an operation without variables.

I opted to produce the more appropriate Record<PropertyKey, never>, which effectively represents an object without properties.

@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@captbaritone
Copy link
Contributor

Thanks!

@facebook-github-bot
Copy link
Contributor

@captbaritone merged this pull request in 16910c9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants