Closed maleadt closed 1 year ago
MWE:
function fits_create_img() where N
naxesr = Ref(convert0)
ccall(0, Cint, (Cvoid, Cint, Cint, Ptr{NTuple{N,Int64}}, Cint),
fptr, bitpix_from_type0, N, naxesr, status)
end
mktemp() do _, io
for fname in []
for a in fits_create_img()
end
end
end
The unreachable reached error should also comes from the apply_type_tfunc
change
MWE
julia> a = Array{Int}[[1;]]
1-element Vector{Array{Int64}}:
[1]
julia> f(a) = Array{typeof(a[1])}
f (generic function with 1 method)
julia> @code_warntype f(a)
MethodInstance for f(::Vector{Array{Int64}})
from f(a) @ Main REPL[56]:1
Arguments
#self#::Core.Const(f)
a::Vector{Array{Int64}}
Body::Type{Array{Array{Int64, N}, N} where N}
1 ─ %1 = Main.Array::Core.Const(Array)
│ %2 = Base.getindex(a, 1)::Array{Int64}
│ %3 = Main.typeof(%2)::Type{Array{Int64, N}} where N
│ %4 = Core.apply_type(%1, %3)::Type{Array{Array{Int64, N}, N} where N} # obviously wrong
└── return %4
I cannot reproduce this on current master:
ufechner@ufryzen:~/repos/julia$ ./julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.0-DEV.1292 (2023-05-14)
_/ |\__'_|_|_|\__'_| | Commit 4ed419555a (0 days old master)
|__/ |
julia> function fits_create_img() where N
naxesr = Ref(convert0)
ccall(0, Cint, (Cvoid, Cint, Cint, Ptr{NTuple{N,Int64}}, Cint),
fptr, bitpix_from_type0, N, naxesr, status)
end
WARNING: method definition for fits_create_img at REPL[1]:1 declares type variable N but does not use it.
fits_create_img (generic function with 1 method)
julia> mktemp() do _, io
for fname in []
for a in fits_create_img()
end
end
end
Can this issue be closed?
As seen on PkgEval testing CFITSIO.jl: https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-02/08/CFITSIO.primary.log
Bisected to #48421 (cc @Keno @aviatesk)