type system: declare the T field of TypeEq as Any - #62948
Open
KristofferC wants to merge 1 commit into
Open
KristofferC wants to merge 1 commit into
KristofferC wants to merge 1 commit into
Conversation
Member
Author
|
Bump @Keno |
Keno
approved these changes
Sep 25, 2026
`jl_valid_type_param` admits non-type values as type parameters, so
`Type{1}` and `Type{setindex!}` are constructible (as on 1.13), and
subtyping can also produce such types by binding a typevar to a value.
Declaring the field as `Union{AnyType,TypeVar}` let inference unsoundly
devirtualize on the declared field type, so `show` dispatched a function
value parameter to the `TypeVar` method and dereferenced it as one,
segfaulting. Widen the declared field type to `Any` to match what
construction actually admits (this also restores the inference behavior
of the untyped `.parameters` access on 1.13), and make `modulesof!`
tolerate a non-type parameter.
Fixes #62897
Assisted-by: Claude Code (Fable 5)
KristofferC
force-pushed
the
kc/typeeq-T-any
branch
from
September 25, 2026 17:32
24fda0b to
25933d7
Compare
vtjnash
approved these changes
Sep 25, 2026
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure if this is the best way to solve this but opening anyway and @Keno can say what he thinks.
jl_valid_type_paramadmits non-type values as type parameters, soType{1}andType{setindex!}are constructible (as on 1.13), and subtyping can also produce such types by binding a typevar to a value. Declaring the field asUnion{AnyType,TypeVar}let inference unsoundly devirtualize on the declared field type, soshowdispatched a function value parameter to theTypeVarmethod and dereferenced it as one, segfaulting. Widen the declared field type toAnyto match what construction actually admits (this also restores the inference behavior of the untyped.parametersaccess on 1.13), and makemodulesof!tolerate a non-type parameter.Fixes #62897
This change was written by Claude Code (Fable 5)