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

Fixed an issue in type evaluation of call expressions where the calla… #5547

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

erictraut
Copy link
Collaborator

…ble subexpression evaluates to a union, and the callable subtypes have different signatures. Pyright was previously caching the types from the first subtype, so it didn't re-evaluate using the second subtype (which may require bidirectional type inference). This addresses #5428.

…ble subexpression evaluates to a union, and the callable subtypes have different signatures. Pyright was previously caching the types from the first subtype, so it didn't re-evaluate using the second subtype (which may require bidirectional type inference). This addresses #5428.
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:101:49 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | ConcreteVersion" in function "intersection"
+   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:101:49 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | ConcreteVersion" in function "intersection" (reportGeneralTypeIssues)
-     Type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to type "VersionList"
-       "ClosedOpenRange" is incompatible with "VersionList" (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:101:49 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | StandardVersion" in function "intersection"
+   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:101:49 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | StandardVersion" in function "intersection" (reportGeneralTypeIssues)
-     Type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to type "VersionList"
-       "ClosedOpenRange" is incompatible with "VersionList" (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:106:42 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | StandardVersion" in function "union"
+   /tmp/mypy_primer/projects/spack/lib/spack/spack/test/versions.py:106:42 - error: Argument of type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to parameter "other" of type "ClosedOpenRange | StandardVersion" in function "union" (reportGeneralTypeIssues)
-     Type "VersionList | ClosedOpenRange | StandardVersion | GitVersion" cannot be assigned to type "VersionList"
-       "ClosedOpenRange" is incompatible with "VersionList" (reportGeneralTypeIssues)

dd-trace-py (https://github.com/DataDog/dd-trace-py)
-     Type "IPv4Network | IPv6Network" cannot be assigned to type "IPv4Network"
+     Type "IPv4Network | IPv6Network" cannot be assigned to type "IPv6Network"
-       "IPv6Network" is incompatible with "IPv4Network" (reportGeneralTypeIssues)
+       "IPv4Network" is incompatible with "IPv6Network" (reportGeneralTypeIssues)

@erictraut erictraut merged commit 9aa29e4 into main Jul 20, 2023
12 checks passed
@erictraut erictraut deleted the issue5428 branch July 20, 2023 16:54
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