`matchTypes` to `repairFailures`.
This change handles invalid inout-to-pointer, array-to-pointer, and string-
to-pointer autoclosure conversions in the same way.
autoclosure result type.
Skip `ConstraintLocator::OptionalPayload` when checking if we're in an autoclosure context for
an inout-to-pointer conversion. This lets us apply the `AllowAutoClosurePointerConversion`
constraint fix when the pointer is optional.
This resolves rdar://problem/53532404
Add constraint fix `AllowAutoClosurePointerConversion` and corresponding diagnostic
`AutoClosurePointerConversionFailure`. When we discover that we're trying to do an
inout-to-pointer conversion in `matchTypes`, add the constraint fix, which tries to do the
conversion as if the pointer type is a regular function argument.
Disallow implicit conversion or arguments from Array, String, and
InOut (formed by &) to pointer types if the argument is for an
@autoclosure parameter.
These conversions were really only intended to be used for C/ObjC
interop, and in some contexts like autoclosures they are not safe.
Fixes: rdar://problem/31538995