-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some vararg-related subtyping issues (#31698)
* Fix jl_obvious_subtype with INT vararg constraint * Fix a vararg-related non-transitivity in subtyping * Fix another vararg subtype issue * Take advantage of their being at most one UnionAll wrapped around a Vararg Upon construction, we normalize `Vararg{T, N} where {T,N}` to `Vararg{T where T, N} where N`, thus there can be at most one UnionAll wrapper around a Vararg. In subtyping we were already assuming that there can be at most two such wrappers, so simply adjust that and add an appropriate assertion to make sure we catch any cases where this ever goes wrong. * Rewrite subtype_tuple to fix extra cases * Put back the case for naked varargs * Update test/subtype.jl Co-Authored-By: Keno <keno@alumni.harvard.edu> * Add test for #31805 * Fix style review comments * Rename variable * In person review changes * Fix bug * Handle integer bounds on left arguments in the environment In subtyping proper, variables introduced on the left (i.e. forall variables) don't have any equality constraints, because we have no syntax for creating them. However, intersection does sometimes create such environments, so we need to handle it in subtyping. (Cherry-picked from 4a38e79)
- Loading branch information
Showing
5 changed files
with
419 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.