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))
154154 end
155155 v = atypes. var
156156 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
158166 end
159167 return UnionAll (v, subst_trivial_bounds (atypes. body))
160168end
Original file line number Diff line number Diff line change @@ -3085,3 +3085,8 @@ end
30853085 end
30863086 return x
30873087 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