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

Seems like a bug, complains about property type #30081

Closed
al6x opened this issue Feb 25, 2019 · 1 comment
Closed

Seems like a bug, complains about property type #30081

al6x opened this issue Feb 25, 2019 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Domain: Mapped Types The issue relates to mapped types

Comments

@al6x
Copy link

al6x commented Feb 25, 2019

Code

This code won't compile

export type Errors<D> = {
  readonly [K in (keyof D | 'base')]?: string[]
}

class Model<D> {
  getErrors(): Errors<D> {
    return { base: ['some base error'] }
  }
}

Expected behavior:

It should compile without errors

Playground

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Feb 25, 2019
@weswigham weswigham added Bug A bug in TypeScript Domain: Mapped Types The issue relates to mapped types and removed Needs Investigation This issue needs a team member to investigate its status. labels Feb 26, 2019
@al6x
Copy link
Author

al6x commented Feb 27, 2019

Impressive, I just added that bug a day ago and you already created a PR with the fix.
Thanks for your work!

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: Mapped Types The issue relates to mapped types
Projects
None yet
Development

No branches or pull requests

3 participants