@@ -2750,20 +2750,19 @@ let types = (Base.BitInteger_types..., BigInt, Bool,
2750
2750
Complex{Int}, Complex{UInt}, Complex32, Complex64, Complex128)
2751
2751
for S in types
2752
2752
for op in (+ , - )
2753
- @test Base. promote_op (op, S) === typeof ( op ( one (S)) )
2754
- @inferred Base . promote_op (op, S )
2755
- @inferred op ( one (S) )
2753
+ T = @inferred Base. promote_op (op, S)
2754
+ t = @inferred op ( one (S) )
2755
+ @test T === typeof (t )
2756
2756
end
2757
2757
end
2758
2758
2759
- @test Base. promote_op (! , Bool) === Bool
2760
- @inferred Base. promote_op (! , Bool)
2759
+ @test @inferred (Base. promote_op (! , Bool)) === Bool
2761
2760
2762
- for S in types, T in types
2763
- for op in (+ , - , * , / , ^ , ( == ) )
2764
- @test Base. promote_op (op, S, T) === typeof ( op ( one (S), one (T)) )
2765
- @inferred Base . promote_op (op, S, T )
2766
- @inferred op ( one (S), one (T) )
2761
+ for R in types, S in types
2762
+ for op in (+ , - , * , / , ^ )
2763
+ T = @inferred Base. promote_op (op, R, S )
2764
+ t = @inferred op ( one (R), one (S) )
2765
+ @test T === typeof (t )
2767
2766
end
2768
2767
end
2769
2768
end
@@ -2772,26 +2771,24 @@ let types = (Base.BitInteger_types..., BigInt, Bool,
2772
2771
Rational{Int}, Rational{BigInt},
2773
2772
Float16, Float32, Float64, BigFloat)
2774
2773
for S in types, T in types
2775
- for op in (< , > , <= , >= )
2776
- @test Base. promote_op (op, S, T) === typeof (op (one (S), one (T)))
2777
- @inferred Base. promote_op (op, S, T)
2778
- @inferred op (one (S), one (T))
2774
+ for op in (< , > , <= , >= , (== ))
2775
+ @test @inferred (Base. promote_op (op, S, T)) === Bool
2779
2776
end
2780
2777
end
2781
2778
end
2782
2779
2783
2780
let types = (Base. BitInteger_types... , BigInt, Bool)
2784
2781
for S in types
2785
- @test Base. promote_op (~ , S) === typeof ( ~ one (S) )
2786
- @inferred Base . promote_op ( ~ , S)
2787
- @inferred ~ one (S )
2782
+ T = @inferred Base. promote_op (~ , S)
2783
+ t = @inferred ~ one ( S)
2784
+ @test T === typeof (t )
2788
2785
end
2789
2786
2790
2787
for S in types, T in types
2791
2788
for op in (& , | , << , >> , (>>> ), % , ÷ )
2792
- @test Base. promote_op (op, S, T) === typeof ( op ( one (S), one (T)) )
2793
- @inferred Base . promote_op (op, S, T )
2794
- @inferred op ( one (S), one (T) )
2789
+ T = @inferred Base. promote_op (op, S, T)
2790
+ t = @inferred op ( one (S), one (T) )
2791
+ @test T === typeof (t )
2795
2792
end
2796
2793
end
2797
2794
end
0 commit comments