Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors for missing enum-named properties should attempt to preserve names #50375

Closed
DanielRosenwasser opened this issue Aug 19, 2022 · 1 comment · Fixed by #50382
Closed
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

enum E {
    A
}

let obj: Record<E, any> = {
    // No implementation
}

Expected:

Property '[E.A]' is missing in type '{}' but required in type 'Record<E, any>'.

Actual:

Property '0' is missing in type '{}' but required in type 'Record<E, any>'.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Domain: Error Messages The issue relates to error messaging labels Aug 19, 2022
@DanielRosenwasser
Copy link
Member Author

Thank you @a-tarasyuk!

@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.9.0 milestone Aug 24, 2022
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
1 participant