From 2df2aa0a3b8a18134fdcb897c0d5bfed7fc1f8fb Mon Sep 17 00:00:00 2001 From: Jakub Skotnicki <1700160+Skoti@users.noreply.github.com> Date: Sun, 4 Aug 2024 22:13:54 +0200 Subject: [PATCH] fix Swift 5.8 compilation as it doesn't implement `if` and `switch` expressions (introduced Swift 5.9) --- Sources/protoc-gen-swift/GeneratorOptions.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/protoc-gen-swift/GeneratorOptions.swift b/Sources/protoc-gen-swift/GeneratorOptions.swift index 202e52c06..711bcd922 100644 --- a/Sources/protoc-gen-swift/GeneratorOptions.swift +++ b/Sources/protoc-gen-swift/GeneratorOptions.swift @@ -169,10 +169,10 @@ class GeneratorOptions { self.experimentalStripNonfunctionalCodegen = experimentalStripNonfunctionalCodegen - self.importDirective = switch (implementationOnlyImports, useAccessLevelOnImports) { - case (false, false): .plain - case (false, true): .accessLevel(visibility) - case (true, false): .implementationOnly + switch (implementationOnlyImports, useAccessLevelOnImports) { + case (false, false): self.importDirective = .plain + case (false, true): self.importDirective = .accessLevel(visibility) + case (true, false): self.importDirective = .implementationOnly case (true, true): throw GenerationError.message(message: """ When using access levels on imports the @_implementationOnly option is unnecessary. Disable @_implementationOnly imports.