Pretty sure this is a severe compiler bug breaking typeof via just a simple parametrized type
Julia Programming Language
Pretty sure this is a severe compiler bug breaking typeof via just a simple parametrized type
The following short code yields an incorrect false (in both v1.12.6/7) from a typeof call, or respectively, typeof(x) changes during runtime even though x does not. Short version struct PT{X} field::X PT(x::X) where X = new{X}(x) PT(x::Array{T,N}) where {T,N} = new{Array{T}}(x) end function foo(input) type = typeof(input.field)::DataType output = PT(type) println(PT{DataType} === typeof(output)) # false return output end output = foo(PT(zeros(2))) println(PT{DataT...
0 comments
No comments yet.