From 336cad229cf26a7ed76c3096ff446389cbff8fb8 Mon Sep 17 00:00:00 2001 From: Wowbagger's Liquid Lunch <55120045+WowbaggersLiquidLunch@users.noreply.github.com> Date: Tue, 3 Nov 2020 21:55:24 -0500 Subject: [PATCH] add missing parameter in `Error.backwardIncompatiblePre5_3_1(.unidentified, specifiedVersion: version)` and change the error message to suggest the specified version instead of the current version --- Sources/PackageLoading/ToolsVersionLoader.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/PackageLoading/ToolsVersionLoader.swift b/Sources/PackageLoading/ToolsVersionLoader.swift index ee8b2c12c61..0cc160f43fa 100644 --- a/Sources/PackageLoading/ToolsVersionLoader.swift +++ b/Sources/PackageLoading/ToolsVersionLoader.swift @@ -218,7 +218,7 @@ public class ToolsVersionLoader: ToolsVersionLoaderProtocol { case .spacingAfterLabel(let spacing): return "horizontal whitespace sequence \(unicodeCodePointsPrefixedByUPlus(of: spacing)) immediately preceding the version specifier is supported by only Swift > 5.3; consider removing the sequence for Swift \(specifiedVersion)" case .unidentified: - return "the manifest is backward-incompatible with Swift ≤ 5.3, but the package manager is unable to pinpoint the exact incompatibility; consider replacing the current Swift tools version specification with '// swift-tools-version:\(ToolsVersion.currentToolsVersion)' to specify the current Swift toolchain version as the lowest Swift version supported by the project, then move the new specification to the very beginning of this manifest file; additionally, please consider filing a bug report on https://bugs.swift.org with this file attached" + return "the manifest is backward-incompatible with Swift ≤ 5.3, but the package manager is unable to pinpoint the exact incompatibility; consider replacing the current Swift tools version specification with '// swift-tools-version:\(specifiedVersion)' to specify Swift \(specifiedVersion) as the lowest Swift version supported by the project, then move the new specification to the very beginning of this manifest file; additionally, please consider filing a bug report on https://bugs.swift.org with this file attached" } } @@ -420,7 +420,7 @@ public class ToolsVersionLoader: ToolsVersionLoaderProtocol { // The above If-statements should have covered all possible backward incompatibilities with Swift ≤ 5.3. // If you changed the logic in this file, and this fatal error is triggered, then you need to re-check the logic, and make sure all possible error conditions are covered in the Else-block. - throw Error.backwardIncompatiblePre5_3_1(.unidentified) + throw Error.backwardIncompatiblePre5_3_1(.unidentified, specifiedVersion: version) } return version