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

feat(extendsMappedType): make sure extending mapped types do not prevent to compile #241

Merged
merged 4 commits into from
Feb 16, 2020

Conversation

uittorio
Copy link
Member

This PR will make sure that if an interface/class extends a mapped type it will not prevent to compile.

#238

Is a temporary solution until we find a better implementation for this scenario

@uittorio uittorio requested a review from Pmyl February 16, 2020 12:48
const properties: PropertyLike[] = propertiesSymbol.map((prop: ts.Symbol) => prop.declarations[0]) as PropertyLike[];
const properties: PropertyLike[] = propertiesSymbol
.filter((prop: ts.Symbol) => !!prop.declarations) // Dynamically generated properties (mapped types) do not have declarations
.map((prop: ts.Symbol) => prop?.declarations[0]) as PropertyLike[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the ? is not needed here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks :)

@uittorio uittorio merged commit 627b9bc into master Feb 16, 2020
@uittorio uittorio deleted the feature/extendsMappedTypes-safe-failure branch February 16, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants