60
60
# issue #42835
61
61
@test ! Core. Compiler. type_more_complex (Int, Any, Core. svec (), 1 , 1 , 1 )
62
62
@test ! Core. Compiler. type_more_complex (Int, Type{Int}, Core. svec (), 1 , 1 , 1 )
63
- @test ! Core. Compiler. type_more_complex (Type{Int}, Any, Core. svec (), 1 , 1 , 1 )
63
+ @test Core. Compiler. type_more_complex (Type{Int}, Any, Core. svec (), 1 , 1 , 1 ) # maybe should be fixed?
64
+ @test Core. Compiler. limit_type_size (Type{Int}, Any, Union{}, 0 , 0 ) == Type{Int}
64
65
@test Core. Compiler. type_more_complex (Type{Type{Int}}, Type{Int}, Core. svec (Type{Int}), 1 , 1 , 1 )
65
66
@test Core. Compiler. type_more_complex (Type{Type{Int}}, Int, Core. svec (Type{Int}), 1 , 1 , 1 )
66
67
@test Core. Compiler. type_more_complex (Type{Type{Int}}, Any, Core. svec (), 1 , 1 , 1 )
71
72
@test Core. Compiler. type_more_complex (ComplexF32, Type{ComplexF32}, Core. svec (), 1 , 1 , 1 )
72
73
@test ! Core. Compiler. type_more_complex (Type{ComplexF32}, Any, Core. svec (Type{Type{ComplexF32}}), 1 , 1 , 1 )
73
74
@test Core. Compiler. type_more_complex (Type{ComplexF32}, Type{Type{ComplexF32}}, Core. svec (), 1 , 1 , 1 )
74
- @test ! Core. Compiler. type_more_complex (Type{ComplexF32}, ComplexF32, Core. svec (), 1 , 1 , 1 )
75
+ @test Core. Compiler. type_more_complex (Type{ComplexF32}, ComplexF32, Core. svec (), 1 , 1 , 1 )
76
+ @test Core. Compiler. limit_type_size (Type{ComplexF32}, ComplexF32, Union{}, 1 , 1 ) == Type{<: Complex }
75
77
@test Core. Compiler. type_more_complex (Type{ComplexF32}, Any, Core. svec (), 1 , 1 , 1 )
76
78
@test Core. Compiler. type_more_complex (Type{Type{ComplexF32}}, Type{ComplexF32}, Core. svec (Type{ComplexF32}), 1 , 1 , 1 )
77
79
@test Core. Compiler. type_more_complex (Type{Type{ComplexF32}}, ComplexF32, Core. svec (ComplexF32), 1 , 1 , 1 )
78
80
@test Core. Compiler. type_more_complex (Type{Type{Type{ComplexF32}}}, Type{Type{ComplexF32}}, Core. svec (Type{ComplexF32}), 1 , 1 , 1 )
79
81
80
82
# n.b. Type{Type{Union{}} === Type{Core.TypeofBottom}
81
- @test ! Core. Compiler. type_more_complex (Type{Union{}}, Any, Core. svec (), 1 , 1 , 1 )
82
- @test ! Core. Compiler. type_more_complex (Type{Type{Union{}}}, Any, Core. svec (), 1 , 1 , 1 )
83
+ @test Core. Compiler. type_more_complex (Type{Union{}}, Any, Core. svec (), 1 , 1 , 1 )
84
+ @test Core. Compiler. type_more_complex (Type{Type{Union{}}}, Any, Core. svec (), 1 , 1 , 1 )
83
85
@test Core. Compiler. type_more_complex (Type{Type{Type{Union{}}}}, Any, Core. svec (), 1 , 1 , 1 )
84
86
@test Core. Compiler. type_more_complex (Type{Type{Type{Union{}}}}, Type{Type{Union{}}}, Core. svec (Type{Type{Union{}}}), 1 , 1 , 1 )
85
87
@test Core. Compiler. type_more_complex (Type{Type{Type{Type{Union{}}}}}, Type{Type{Type{Union{}}}}, Core. svec (Type{Type{Type{Union{}}}}), 1 , 1 , 1 )
86
88
87
89
@test ! Core. Compiler. type_more_complex (Type{1 }, Type{2 }, Core. svec (), 1 , 1 , 1 )
88
90
@test Core. Compiler. type_more_complex (Type{Union{Float32,Float64}}, Union{Float32,Float64}, Core. svec (Union{Float32,Float64}), 1 , 1 , 1 )
89
- @test ! Core. Compiler. type_more_complex (Type{Union{Float32,Float64}}, Union{Float32,Float64}, Core. svec (Union{Float32,Float64}), 0 , 1 , 1 )
91
+ @test Core. Compiler. type_more_complex (Type{Union{Float32,Float64}}, Union{Float32,Float64}, Core. svec (Union{Float32,Float64}), 0 , 1 , 1 )
90
92
@test Core. Compiler. type_more_complex (Type{<: Union{Float32,Float64} }, Type{Union{Float32,Float64}}, Core. svec (Union{Float32,Float64}), 1 , 1 , 1 )
91
93
@test Core. Compiler. type_more_complex (Type{<: Union{Float32,Float64} }, Any, Core. svec (Union{Float32,Float64}), 1 , 1 , 1 )
92
94
@@ -101,6 +103,44 @@ let # 40336
101
103
@test t != = r && t <: r
102
104
end
103
105
106
+ @test Core. Compiler. limit_type_size (Type{Type{Type{Int}}}, Type, Union{}, 0 , 0 ) == Type{<: Type }
107
+ @test Core. Compiler. limit_type_size (Type{Type{Int}}, Type, Union{}, 0 , 0 ) == Type{<: Type }
108
+ @test Core. Compiler. limit_type_size (Type{Int}, Type, Union{}, 0 , 0 ) == Type{Int}
109
+ @test Core. Compiler. limit_type_size (Type{<: Int }, Type, Union{}, 0 , 0 ) == Type{<: Int }
110
+ @test Core. Compiler. limit_type_size (Type{ComplexF32}, ComplexF32, Union{}, 0 , 0 ) == Type{<: Complex } # added nesting
111
+ @test Core. Compiler. limit_type_size (Type{ComplexF32}, Type{ComplexF64}, Union{}, 0 , 0 ) == Type{ComplexF32} # base matches
112
+ @test Core. Compiler. limit_type_size (Type{ComplexF32}, Type, Union{}, 0 , 0 ) == Type{<: Complex }
113
+ @test_broken Core. Compiler. limit_type_size (Type{<: ComplexF64 }, Type, Union{}, 0 , 0 ) == Type{<: Complex }
114
+ @test Core. Compiler. limit_type_size (Type{<: ComplexF64 }, Type, Union{}, 0 , 0 ) == Type # 50692
115
+ @test Core. Compiler. limit_type_size (Type{Union{ComplexF32,ComplexF64}}, Type, Union{}, 0 , 0 ) == Type
116
+ @test_broken Core. Compiler. limit_type_size (Type{Union{ComplexF32,ComplexF64}}, Type, Union{}, 0 , 0 ) == Type{<: Complex } # 50692
117
+ @test Core. Compiler. limit_type_size (Type{Union{Float32,Float64}}, Type, Union{}, 0 , 0 ) == Type
118
+ @test Core. Compiler. limit_type_size (Type{Union{Int,Type{Int}}}, Type{Type{Int}}, Union{}, 0 , 0 ) == Type
119
+ @test Core. Compiler. limit_type_size (Type{Union{Int,Type{Int}}}, Union{Type{Int},Type{Type{Int}}}, Union{}, 0 , 0 ) == Type
120
+ @test Core. Compiler. limit_type_size (Type{Union{Int,Type{Int}}}, Type{Union{Type{Int},Type{Type{Int}}}}, Union{}, 0 , 0 ) == Type{Union{Int64, Type{Int64}}}
121
+ @test Core. Compiler. limit_type_size (Type{Union{Int,Type{Int}}}, Type{Type{Int}}, Union{}, 0 , 0 ) == Type
122
+
123
+
124
+ # issue #43296 #43296
125
+ struct C43296{t,I} end
126
+ r43296 (b) = r43296 (typeof (b))
127
+ r43296 (:: Type ) = nothing
128
+ r43296 (:: Nothing ) = nonexistent
129
+ r43296 (:: Type{C43296{c,d}} ) where {c,d} = f43296 (r43296 (c), e)
130
+ f43296 (:: Nothing , :) = nothing
131
+ f43296 (g, :) = h
132
+ k43296 (b, j, :) = l
133
+ k43296 (b, j, :: Nothing ) = b
134
+ i43296 (b, j) = k43296 (b, j, r43296 (j))
135
+ @test only (Base. return_types (i43296, (Int, C43296{C43296{C43296{Val, Tuple}, Tuple}}))) == Int
136
+
137
+ abstract type e43296{a, j} <: AbstractArray{a, j} end
138
+ abstract type b43296{a, j, c, d} <: e43296{a, j} end
139
+ struct h43296{a, j, f, d, i} <: b43296{a, j, f, d} end
140
+ Base. ndims (:: Type{f} ) where {f<: e43296 } = ndims (supertype (f))
141
+ Base. ndims (g:: e43296 ) = ndims (typeof (g))
142
+ @test only (Base. return_types (ndims, (h43296{Any, 0 , Any, Int, Any},))) == Int
143
+
104
144
@test Core. Compiler. unionlen (Union{}) == 1
105
145
@test Core. Compiler. unionlen (Int8) == 1
106
146
@test Core. Compiler. unionlen (Union{Int8, Int16}) == 2
0 commit comments