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

segmentation fault by wrong type-var input in 1.9+ #49390

Closed
lmiq opened this issue Apr 17, 2023 · 2 comments
Closed

segmentation fault by wrong type-var input in 1.9+ #49390

lmiq opened this issue Apr 17, 2023 · 2 comments

Comments

@lmiq
Copy link
Contributor

lmiq commented Apr 17, 2023

This crashes Julia 1.9 (rc1 or rc2) with a segmentation fault:

foo(a::AbstractArray{T, N}) where {N, T<:Tuple{zeros(Int,Val(N))...}} = a

In 1.8 or 1.6 it gives:

julia> foo(a::AbstractArray{T, N}) where {N, T<:Tuple{zeros(Int,Val(N))...}} = a
ERROR: UndefVarError: x not defined
Stacktrace:
 [1] Val{N}()
   @ Base ./essentials.jl:712
 [2] Val(x::TypeVar)
   @ Base ./essentials.jl:714
 [3] top-level scope
   @ REPL[1]:1

(which is a strange error message, but that's another problem)

@KristofferC
Copy link
Sponsor Member

I think this is a dup of #49203

@lmiq lmiq changed the title segmentation fault by wront type-var input in 1.9+ segmentation fault by wrong type-var input in 1.9+ Apr 17, 2023
@fingolfin
Copy link
Contributor

This works in Julia 1.9.1:

julia> foo(a::AbstractArray{T, N}) where {N, T<:Tuple{zeros(Int,Val(N))...}} = a
ERROR: TypeError: in new, expected DataType, got Type{Val{N}}
Stacktrace:
 [1] Val
   @ ./essentials.jl:799 [inlined]
 [2] Val(x::TypeVar)
   @ Base ./essentials.jl:801
 [3] top-level scope
   @ REPL[1]:1

@vtjnash vtjnash closed this as completed Jun 28, 2023
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

No branches or pull requests

4 participants