@@ -121,15 +121,15 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
121121 @test (2 : 5 , - 1 : 4 ) === @inferred as (Tuple, CartesianIndices ((2 : 5 , - 1 : 4 )))
122122 @test (2 : 5 , - 1 : 4 ) === @inferred as (NTuple{2 }, CartesianIndices ((2 : 5 , - 1 : 4 )))
123123
124- @test CartesianIndex () === @inferred as (CartesianIndex,())
124+ @test CartesianIndex () === @inferred as (CartesianIndex,())
125125 @test CartesianIndex ((1 ,2 ,3 )) === @inferred as (CartesianIndex, CartesianIndex ((1 ,2 ,3 )))
126126 @test CartesianIndex ((1 ,2 ,3 )) === @inferred as (CartesianIndex{3 }, CartesianIndex ((1 ,2 ,3 )))
127127 @test CartesianIndex ((1 ,2 ,3 )) === @inferred as (CartesianIndex, (0x1 ,2 ,Int16 (3 )))
128128 @test CartesianIndex ((1 ,2 ,3 )) === @inferred as (CartesianIndex{3 }, (0x1 ,2 ,Int16 (3 )))
129129
130- @test CartesianIndices (()) === @inferred as (CartesianIndices,())
131- @test CartesianIndices ((2 : 3 ,6 )) === @inferred as (CartesianIndices,(2 : 3 ,6 ))
132- @test CartesianIndices ((2 : 3 ,6 )) === @inferred as (CartesianIndices,CartesianIndices ((2 : 3 ,6 )))
130+ @test CartesianIndices (()) === @inferred as (CartesianIndices,())
131+ @test CartesianIndices ((2 : 3 ,6 )) === @inferred as (CartesianIndices,(2 : 3 ,6 ))
132+ @test CartesianIndices ((2 : 3 ,6 )) === @inferred as (CartesianIndices,CartesianIndices ((2 : 3 ,6 )))
133133 @test CartesianIndices ((2 : 3 ,6 ,- 1 : 4 )) === @inferred as (CartesianIndices{3 },(2 : 3 ,6 ,- 1 : 4 ))
134134 @test CartesianIndices ((2 : 3 ,6 ,- 1 : 4 )) === @inferred as (CartesianIndices{3 },CartesianIndices ((2 : 3 ,6 ,- 1 : 4 )))
135135
@@ -527,12 +527,13 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
527527 @test_throws ErrorException bare_type (AbstractString)
528528
529529 # bare_type with multiple arguments
530- @test Float32 === @inferred bare_type (1 , 0f0 )
531- @test promote_type (Int, typeof (pi )) === @inferred bare_type (Int, pi )
532- @test promote_type (Int, typeof (pi ), Float64) === @inferred bare_type (4 , pi , 1.0 )
533- @test promote_type (Int, Int8, Float32) === @inferred bare_type (Int, Int8, Float32)
534- @test promote_type (Int, Int8, Float32) === @inferred bare_type (Int, Int8, Float32)
535- @test promote_type (Int, Int8, Int16, Float32) === #= @inferred=# bare_type (Int, Int8, Int16, Float32)
530+ @test Float32 === @inferred bare_type (1 , 0f0 )
531+ @test promote_type (Int, typeof (pi )) === @inferred bare_type (Int, pi )
532+ @test promote_type (Int, typeof (pi ), Float64) === @inferred bare_type (4 , pi , 1.0 )
533+ @test promote_type (Int, Int8, Float32) === @inferred bare_type (Int, Int8, Float32)
534+ @test promote_type (Int, Int8, Int16, Float32) === @inferred bare_type (Int, Int8, Int16, Float32)
535+ @test promote_type (Int, Int8, Int16, Float32, Bool) === @inferred bare_type (Int, Int8, Int16, Float32, Bool)
536+ @test promote_type (Int, Int8, Int16, Float32, Bool, UInt16) === @inferred bare_type (Int, Int8, Int16, Float32, Bool, UInt16)
536537
537538 # default implementation
538539 @test Float32 === @inferred bare_type (MyNumber (1.2f0 ))
@@ -583,12 +584,14 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
583584 @test_throws ErrorException real_type (AbstractString)
584585
585586 # real_type with multiple arguments
586- @test Float32 === @inferred real_type (1 , 0f0 )
587- @test promote_type (Int, typeof (pi )) === @inferred real_type (Int, pi )
588- @test promote_type (Int, typeof (pi ), Float64) === @inferred real_type (4 , pi , 1.0 )
589- @test promote_type (Int, Int8, Float32) === @inferred real_type (Int, Int8, Float32)
590- @test promote_type (Int, Int8, Float32) === @inferred real_type (Int, Int8, Float32)
591- @test promote_type (Int, Int8, Int16, Float32) === #= @inferred=# real_type (Int, Int8, Complex{Int16}, Float32)
587+ @test Float32 === @inferred real_type (1 , 0f0 )
588+ @test promote_type (Int, typeof (pi )) === @inferred real_type (Int, pi )
589+ @test promote_type (Int, typeof (pi ), Float64) === @inferred real_type (4 , pi , 1.0 )
590+ @test promote_type (Int, Int8, Float32) === @inferred real_type (Int, Int8, Float32)
591+ @test promote_type (Int, Int8, Int16, Float32) === @inferred real_type (Int, Int8, Int16, Float32)
592+ @test promote_type (Int, Int8, Int16, Float32, Bool) === @inferred real_type (Int, Int8, Int16, Float32, Bool)
593+ @test promote_type (Int, Int8, Int16, Float32, Bool, UInt16) === @inferred real_type (Int, Int8, Int16, Float32, Bool, UInt16)
594+ @test promote_type (Int, Int8, Int16, Float32, Bool, UInt16) === @inferred real_type (Int, Int8, Int16, Complex{Float32}, Bool, UInt16)
592595
593596 # default implementation
594597 @test Float32 === @inferred real_type (MyNumber (1.2f0 ))
@@ -630,7 +633,8 @@ same_value_and_type(x::T, y::T) where {T} = (x === y) || (x == y)
630633 @test float (Int16) === @inferred floating_point_type (Int16)
631634 @test Float32 === @inferred floating_point_type (Int16, Float32)
632635 @test Float64 === @inferred floating_point_type (Int16, Float32, Complex{Float64})
633- @test Float32 === #= @inferred=# floating_point_type (Int16, Float32, Complex{Float16}, 0x1 )
636+ @test Float32 === @inferred floating_point_type (Int16, Float32, Complex{Float16}, 0x1 )
637+ @test Float32 === @inferred floating_point_type (Int16, Float32, Complex{Float16}, 0x1 , - 42 )
634638
635639 # convert_floating_point_type
636640 @test - 1.0 === @inferred convert_floating_point_type (Int, - 1 )
0 commit comments