Files
swift-mirror/lib/Sema/CSSimplify.cpp
Pavel Yaskevich 143931ac08 [CSSimplify] Increase impact of a generic argument mismatch if mismatch is contextual
If generic arguments mismatch ends up being recorded on the result
of the chain or `try` expression it means that there is a contextual
conversion mismatch.

For optional conversions the solver currently generates a disjunction
with two choices - bind and optional-to-optional conversion which is
anchored on the contextual expression. If we can get a fix recorded
there that would result in a better diagnostic. It's only possible
for optional-to-optional choice because it doesn't bind the
variable immediately, so we need to downgrade direct fixes to prevent
`bind` choice from considered better.

(cherry picked from commit 65e83a8bb1)
2025-06-03 09:33:13 -07:00

635 KiB