mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
The compiler previously crashed when diagnosing missing arguments in KeyPathExpr (e.g., \.split(separator: ",")). This occurred because getFunctionArgApplyInfo failed to handle KeyPathExpr anchors, and CSDiagnostics.cpp blindly unwrapped the result. This change fixes the crash by: - Retrieving KeyPath Overloads: Updating ConstraintSystem::getFunctionArgApplyInfo to scan the locator path for the KeyPathComponent. This allows us to retrieve the correct argument list and overload choice (function type) when available. - Adding Safety Check: Updating MissingArgumentsFailure::diagnoseAsError to safely check if FunctionArgApplyInfo was successfully created before accessing it. This ensures graceful failure if the solver cannot determine the overload for the malformed component.
190 KiB
190 KiB