@@ -2764,20 +2764,19 @@ let types = (Base.BitInteger_types..., BigInt, Bool,
27642764 Complex{Int}, Complex{UInt}, Complex32, Complex64, Complex128)
27652765 for S in types
27662766 for op in (+ , - )
2767- @test Base. promote_op (op, S) === typeof ( op ( one (S)) )
2768- @inferred Base . promote_op (op, S )
2769- @inferred op ( one (S) )
2767+ T = @inferred Base. promote_op (op, S)
2768+ t = @inferred op ( one (S) )
2769+ @test T === typeof (t )
27702770 end
27712771 end
27722772
2773- @test Base. promote_op (! , Bool) === Bool
2774- @inferred Base. promote_op (! , Bool)
2773+ @test @inferred (Base. promote_op (! , Bool)) === Bool
27752774
2776- for S in types, T in types
2777- for op in (+ , - , * , / , ^ , ( == ) )
2778- @test Base. promote_op (op, S, T) === typeof ( op ( one (S), one (T)) )
2779- @inferred Base . promote_op (op, S, T )
2780- @inferred op ( one (S), one (T) )
2775+ for R in types, S in types
2776+ for op in (+ , - , * , / , ^ )
2777+ T = @inferred Base. promote_op (op, R, S )
2778+ t = @inferred op ( one (R), one (S) )
2779+ @test T === typeof (t )
27812780 end
27822781 end
27832782end
@@ -2786,26 +2785,24 @@ let types = (Base.BitInteger_types..., BigInt, Bool,
27862785 Rational{Int}, Rational{BigInt},
27872786 Float16, Float32, Float64, BigFloat)
27882787 for S in types, T in types
2789- for op in (< , > , <= , >= )
2790- @test Base. promote_op (op, S, T) === typeof (op (one (S), one (T)))
2791- @inferred Base. promote_op (op, S, T)
2792- @inferred op (one (S), one (T))
2788+ for op in (< , > , <= , >= , (== ))
2789+ @test @inferred (Base. promote_op (op, S, T)) === Bool
27932790 end
27942791 end
27952792end
27962793
27972794let types = (Base. BitInteger_types... , BigInt, Bool)
27982795 for S in types
2799- @test Base. promote_op (~ , S) === typeof ( ~ one (S) )
2800- @inferred Base . promote_op ( ~ , S)
2801- @inferred ~ one (S )
2796+ T = @inferred Base. promote_op (~ , S)
2797+ t = @inferred ~ one ( S)
2798+ @test T === typeof (t )
28022799 end
28032800
28042801 for S in types, T in types
28052802 for op in (& , | , << , >> , (>>> ), % , ÷ )
2806- @test Base. promote_op (op, S, T) === typeof ( op ( one (S), one (T)) )
2807- @inferred Base . promote_op (op, S, T )
2808- @inferred op ( one (S), one (T) )
2803+ T = @inferred Base. promote_op (op, S, T)
2804+ t = @inferred op ( one (S), one (T) )
2805+ @test T === typeof (t )
28092806 end
28102807 end
28112808end
0 commit comments