Skip to content

Make anyFunctionType a supertype in strict subtype relation #850

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

Merged
merged 3 commits into from
May 7, 2025

Conversation

ahejlsberg
Copy link
Member

Fixes #849.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses issue #849 by modifying the signature relationship logic so that anyFunctionType becomes a supertype when the relation is in a strict subtype context.

  • Adjust the conditional in signaturesRelatedTo to only return TernaryTrue when target is anyFunctionType or when source is anyFunctionType under non-strict subtype relations.

@jakebailey
Copy link
Member

Could you add this as a test to testdata/tests/cases/compiler, since nothing else seems to change?

@ahejlsberg ahejlsberg added this pull request to the merge queue May 7, 2025
Merged via the queue into main with commit 68dd286 May 7, 2025
23 checks passed
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.

Condition in body removes contextual type of later return statement
2 participants