Commit Graph

10 Commits

Author SHA1 Message Date
Pavel Yaskevich
4132aa04f9 [Tests] NFC: Update all of the test-cases improved by changes to generic argument mismatch handling 2025-06-03 00:49:06 -07:00
Pavel Yaskevich
55b8d9538d [CSSimplify] Rework how/when mismatches between optional types are fixed
- Don't attempt to insert fixes if there are restrictions present, they'd inform the failures.

  Inserting fixes too early doesn't help the solver because restriction matching logic would
  record the same fixes.

- Adjust impact of the fixes.

  Optional conversions shouldn't impact the score in any way because
  they are not the source of the issue.

- Look through one level of optional when failure is related to optional injection.

  The diagnostic is going to be about underlying type, so there is no reason to print
  optional on right-hand side.
2024-09-10 10:35:05 -07:00
Pavel Yaskevich
e4eb271359 [CSSimplify] Implement ArrayToCPointer conversion
Extends implementation to support conversions between arrays
and pointers that are allowed by the SE-0324 proposal.

Resolved: rdar://99089335
2023-03-14 14:36:52 -07:00
Pavel Yaskevich
0a5b3f0727 [TypeChecker] SE-0324: Extend Swift -> C pointer conversions to inout
Fixes an oversight where `inout` -> C pointer conversion wasn't covered
by implementation of new pointer conversion semantics proposed by SE-0324.

Resolves: rdar://92583588
2022-05-25 20:55:22 -07:00
Pavel Yaskevich
a9fdb7ad66 [CSSimplify] Detect and diagnose Swift -> C pointer conversion failures
Detect and diagnose situations when Swift -> C pointer conversion
is unsupported due to method not being imported from C header.
2021-09-20 17:22:26 -07:00
Pavel Yaskevich
5cb8604b60 [ConstraintSystem] De-prioritize solutions with Swift -> C pointer conversions
Just like other implicit conversions - always prefer solutions with
the lowest possible number of them.
2021-09-20 17:22:26 -07:00
Pavel Yaskevich
416388191f [TypeChecker] NFC: Enable Swift -> C implicit pointer conversions tests only on Darwin 2021-09-20 17:22:26 -07:00
Pavel Yaskevich
7c754ee753 [TypeChecker] NFC: Test Swift -> C pointer conversions for [U]Int8 pointers 2021-09-20 17:22:26 -07:00
Pavel Yaskevich
216f8a0146 [TypeChecker] NFC: Add test-cases for Swift -> C pointer conversions
Make sure that conversions are properly supported when arguments
either is wrapped in an optional type or requires a value-to-optional
promotion because parameter is optional pointer.
2021-09-20 17:22:26 -07:00
Pavel Yaskevich
621ea81e7b [ConstraintSystem] NFC: Add test-cases for interactions between Swift and C pointers 2021-09-20 17:22:25 -07:00