File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,15 @@ function subst_trivial_bounds(@nospecialize(atypes))
154
154
end
155
155
v = atypes. var
156
156
if isconcretetype (v. ub) || v. lb === v. ub
157
- return subst_trivial_bounds (atypes{v. ub})
157
+ subst = try
158
+ atypes{v. ub}
159
+ catch
160
+ # Note in rare cases a var bound might not be valid to substitute.
161
+ nothing
162
+ end
163
+ if subst != = nothing
164
+ return subst_trivial_bounds (subst)
165
+ end
158
166
end
159
167
return UnionAll (v, subst_trivial_bounds (atypes. body))
160
168
end
Original file line number Diff line number Diff line change @@ -3085,3 +3085,8 @@ end
3085
3085
end
3086
3086
return x
3087
3087
end ) === Union{Int, Float64, Char}
3088
+
3089
+ # issue #41908
3090
+ f41908 (x:: Complex{T} ) where {String<: T <: String } = 1
3091
+ g41908 () = f41908 (Any[1 ][1 ])
3092
+ @test only (Base. return_types (g41908, ())) <: Int
You can’t perform that action at this time.
0 commit comments