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

Ignore bivariance in subtype relationship #41979

Closed
wants to merge 10 commits into from

Conversation

RyanCavanaugh
Copy link
Member

Evaluates a potential fix for #41977

@RyanCavanaugh RyanCavanaugh added the Experiment A fork with an experimental idea which might not make it into master label Dec 15, 2020
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Dec 15, 2020
@RyanCavanaugh
Copy link
Member Author

Rebuilt on top of #31023 which is an effective prerequisite to this being palatable

@RyanCavanaugh
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @RyanCavanaugh, I've started to run the parallelized community code test suite on this PR at 7479b8a. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 7479b8a. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 16, 2020

Heya @RyanCavanaugh, I've started to run the parallelized Definitely Typed test suite on this PR at 7479b8a. You can monitor the build here.

@@ -36,7 +36,7 @@ namespace ts {
return undefined;
}
else if (isArray(visited)) {
visitedNode = (lift || extractSingleNode)(visited);
visitedNode = (lift || extractSingleNode)(visited as unknown as NodeArray<Node>);
Copy link
Member Author

Choose a reason for hiding this comment

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

cc @weswigham @ahejlsberg interesting break here. visited is narrowed to Node[] here, but lift is undefined | (arg: NodeArray<Node>) => Node, so we were passing what we only proved to be a Node[] to something that needed a subtype of Node[]. It's not immediately clear to me if this is a bug-in-fact but it's definitely not correct per our normal definitions, i.e. you could not have written

if (lift) lift(visited);

on this line

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@RyanCavanaugh
Copy link
Member Author

Closing in favor of the more targeted fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team Experiment A fork with an experimental idea which might not make it into master For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants