You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module Test
import Base: length, iterate, real
abstract type AbstractType{T} end@inlinelength(p::T) where T <:AbstractType=1@inlineiterate(p::T) where T <:AbstractType= (p,nothing)
#@inline iterate(p::T,st) where T <: AbstractType = nothing@inlinereal(p::T) where T <:AbstractType= p
end# module Testimport.Test.AbstractType
struct S{T<:Number} <:AbstractType{T}
x::Tendtest(x, y) = x
@code_warntypetest.(S(0), [0])
Gives output:
If uncomment
@inline iterate(p::T,st) where T <: AbstractType = nothing
, it gives a type unstable warning:julia 1.7.0-DEV.334
gives unstable warning:julia 1.5.2
gives a different unstable warning:It seems that the compiler is confused with
BitArray
andArray
.The text was updated successfully, but these errors were encountered: