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

Avoid getting undefined callSignatures/constructSignatures in getPropertyOfType #42766

Merged
merged 1 commit into from Feb 11, 2021

Conversation

@elibarzilay
Copy link
Member

@elibarzilay elibarzilay commented Feb 11, 2021

e350c35 (#40228) introduced a subtle bug: it switched the flags to an
alias, dropping SymbolFlags.Property --- and that makes
symbolIsValue() get to the resolveAlias(symbol) call, which leads to
getPropertyOfType() withresolved.callSignatures+constructSignatures
being undefined. So initialize them in setStructuredTypeMembers
before calling getNamedMembers().

Fixes #42350

@sandersn
Copy link
Member

@sandersn sandersn commented Feb 11, 2021

Looks like lots of failing tests from CI, so this fix may not be as simple as we thought it was.

…tPropertyOfType`

e350c35 (#40228) introduced a subtle bug: it switched the flags to an
alias, dropping `SymbolFlags.Property` --- and that makes
`symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to
`getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures`
being `undefined`.  So initialize them in `setStructuredTypeMembers`
before calling `getNamedMembers()`.

Fixes #42350
@elibarzilay elibarzilay force-pushed the elibarzilay:42350 branch from 5a903d3 to ed26816 Feb 11, 2021
@elibarzilay
Copy link
Member Author

@elibarzilay elibarzilay commented Feb 11, 2021

Should be fixed now.

@elibarzilay elibarzilay merged commit c7bac6f into microsoft:master Feb 11, 2021
9 checks passed
9 checks passed
@github-actions
build (10.x)
Details
@github-actions
CodeQL-Build CodeQL-Build
Details
@github-actions
build (12.x)
Details
@github-actions
build (14.x)
Details
@github-code-scanning
CodeQL No new or fixed alerts
Details
@microsoft-cla
license/cla All CLA requirements met.
Details
@azure-pipelines
node10 Build #95705 succeeded
Details
@azure-pipelines
node12 Build #95703 succeeded
Details
@azure-pipelines
node14 Build #95704 succeeded
Details
@elibarzilay elibarzilay deleted the elibarzilay:42350 branch Feb 11, 2021
@andrewbranch
Copy link
Member

@andrewbranch andrewbranch commented Feb 25, 2021

This didn’t make it into 4.2. I’m assuming that was unintentional, since the bug was milestoned as 4.2.1? /cc @DanielRosenwasser

@typescript-bot cherry-pick this to release-4.2

@typescript-bot
Copy link
Collaborator

@typescript-bot typescript-bot commented Feb 25, 2021

Heya @andrewbranch, I've started to run the task to cherry-pick this into release-4.2 on this PR at ed26816. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

@typescript-bot typescript-bot commented Feb 25, 2021

Hey @andrewbranch, I've opened #42950 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Feb 25, 2021
Component commits:
ed26816 Avoid getting undefined `callSignatures`/`constructSignatures` in `getPropertyOfType`
e350c35 (microsoft#40228) introduced a subtle bug: it switched the flags to an
alias, dropping `SymbolFlags.Property` --- and that makes
`symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to
`getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures`
being `undefined`.  So initialize them in `setStructuredTypeMembers`
before calling `getNamedMembers()`.

Fixes microsoft#42350
RyanCavanaugh pushed a commit that referenced this pull request Feb 25, 2021
Component commits:
ed26816 Avoid getting undefined `callSignatures`/`constructSignatures` in `getPropertyOfType`
e350c35 (#40228) introduced a subtle bug: it switched the flags to an
alias, dropping `SymbolFlags.Property` --- and that makes
`symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to
`getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures`
being `undefined`.  So initialize them in `setStructuredTypeMembers`
before calling `getNamedMembers()`.

Fixes #42350

Co-authored-by: Eli Barzilay <eli@barzilay.org>
This was referenced Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants