From 0c4b38e9cdbf4a203d0e567e3edbbdbb78b77c5b Mon Sep 17 00:00:00 2001 From: MahdiBM Date: Sun, 27 Oct 2024 20:51:32 +0330 Subject: [PATCH] Fix some errors on nightlies --- .devcontainer/devcontainer.json | 24 +++++++++++++++++++ .../EnumeratorMacroType.swift | 2 +- .../EnumeratorMacroImpl/Types/EArray.swift | 2 +- .../EnumeratorMacroImpl/Types/EOptional.swift | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..63e9745 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "Swift Main", + "image": "swiftlang/swift:nightly-main-jammy", + // Install SwiftFormat + "postStartCommand": "apt update -y && apt install wget apt-utils -y && wget -O - https://github.com/MahdiBM/swift-format-repo/raw/main/install/swift-format-install.sh | bash", + "customizations": { + "vscode": { + "extensions": [ + "sswg.swift-lang", // Swift + "vknabel.vscode-swiftformat", // SwiftFormat + "esbenp.prettier-vscode", // Prettier + "usernamehw.errorlens", // Error Lens + "GitHub.copilot", // GitHub Copilot + "github.vscode-github-actions", // GitHub Actions + "GitHub.vscode-pull-request-github", // GitHub PR / Issues + "eamodio.gitlens", // GitLens (from GitKraken) + "redhat.vscode-yaml" // YAML + ], + "settings": { + "lldb.library": "/usr/lib/liblldb.so" + } + } + } +} diff --git a/Sources/EnumeratorMacroImpl/EnumeratorMacroType.swift b/Sources/EnumeratorMacroImpl/EnumeratorMacroType.swift index 8d19bd7..feb26eb 100644 --- a/Sources/EnumeratorMacroImpl/EnumeratorMacroType.swift +++ b/Sources/EnumeratorMacroImpl/EnumeratorMacroType.swift @@ -74,7 +74,7 @@ extension EnumeratorMacroType: MemberMacro { } let message: MacroError - let errorSyntax: SyntaxProtocol + let errorSyntax: any SyntaxProtocol if let parserError = error as? MustacheTemplate.ParserError { message = .mustacheTemplateError( message: String(describing: parserError.error) diff --git a/Sources/EnumeratorMacroImpl/Types/EArray.swift b/Sources/EnumeratorMacroImpl/Types/EArray.swift index 4163eaf..b5772d7 100644 --- a/Sources/EnumeratorMacroImpl/Types/EArray.swift +++ b/Sources/EnumeratorMacroImpl/Types/EArray.swift @@ -71,7 +71,7 @@ extension EArray: EMustacheTransformable { keyValues.underlying.first(where: { $0.key.underlying == name })?.value ) } - if let comparable = self as? EComparableSequence { + if let comparable = self as? (any EComparableSequence) { /// The underlying type is in charge of adding a diagnostic, if needed. return comparable.comparableTransform(name) } diff --git a/Sources/EnumeratorMacroImpl/Types/EOptional.swift b/Sources/EnumeratorMacroImpl/Types/EOptional.swift index 27cc062..d6636f3 100644 --- a/Sources/EnumeratorMacroImpl/Types/EOptional.swift +++ b/Sources/EnumeratorMacroImpl/Types/EOptional.swift @@ -130,7 +130,7 @@ extension EOptional: EMustacheTransformable { case "exists": return true default: - if let value = value as? EMustacheTransformable { + if let value = value as? (any EMustacheTransformable) { /// The underlying type is in charge of adding a diagnostic, if needed. return value.transform(name) } else {