Commit Graph

6 Commits

Author SHA1 Message Date
Anthony Latsis
14b70f306b DiagnosticVerifier: Default expected fix-it start line to the diagnostic's 2023-03-08 12:10:27 +03:00
Luciano Almeida
3e386550bf Merge pull request #34883 from LucianoPAlmeida/SR-13899-coerce-to-checked
[SR-13899] [Sema] Adjustments on coerce to checked cast diagnostics
2020-12-01 21:30:28 -03:00
Luciano Almeida
c29fbb5528 [test] Adjusting test files where class syntax is used for protocol inheritance 2020-11-29 21:43:50 -03:00
Luciano Almeida
19727f2cc2 [Sema][test] Adjusting all missing downcast diagnostics failures 2020-11-28 18:17:18 -03:00
Slava Pestov
48e89f40d7 Sema: Fix applying solution for OptionalTryExpr
In Swift 5 mode, CSGen generates a conversion constraint from
the type of OptionalTryExpr's subexpression, call it T, and
Optional<$tv> for a new type variable $tv.

When applying the solution, we would coerce the sub-expression
to T? if T was not optional, or T otherwise. This was wrong
because there's no reason that $tv is actually equal to T.

Instead, we must coerce the sub-expression to Optional<$tv>,
which is the type of the overall OptionalTryExpr.

Fixes <rdar://problem/46742002>.
2018-12-15 01:29:07 -05:00
BJ Homer
9aaeaec61f Add test validating that we preserve existing Swift 4 'try?' behavior. 2018-11-08 00:12:38 -07:00