Skip to content

Commit

Permalink
fix Swift 5.8 compilation as it doesn't implement if and switch e…
Browse files Browse the repository at this point in the history
…xpressions (introduced Swift 5.9)
  • Loading branch information
Skoti committed Aug 4, 2024
1 parent 74857e2 commit 2df2aa0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/protoc-gen-swift/GeneratorOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2df2aa0

Please sign in to comment.