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 @@ -156,7 +156,15 @@ function subst_trivial_bounds(@nospecialize(atypes))
156156 end
157157 v = atypes. var
158158 if isconcretetype (v. ub) || v. lb === v. ub
159- return subst_trivial_bounds (atypes{v. ub})
159+ subst = try
160+ atypes{v. ub}
161+ catch
162+ # Note in rare cases a var bound might not be valid to substitute.
163+ nothing
164+ end
165+ if subst != = nothing
166+ return subst_trivial_bounds (subst)
167+ end
160168 end
161169 return UnionAll (v, subst_trivial_bounds (atypes. body))
162170end
Original file line number Diff line number Diff line change @@ -3408,3 +3408,8 @@ end
34083408 @test @inferred (f40177 (T)) == fieldtype (T, 1 )
34093409 end
34103410end
3411+
3412+ # issue #41908
3413+ f41908 (x:: Complex{T} ) where {String<: T <: String } = 1
3414+ g41908 () = f41908 (Any[1 ][1 ])
3415+ @test only (Base. return_types (g41908, ())) <: Int
You can’t perform that action at this time.
0 commit comments