Skip to content

Commit

Permalink
Regenerate.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl committed Aug 13, 2020
1 parent d6422ae commit 0803e98
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions Reference/unittest_swift_oneof_all_required.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,22 @@ struct ProtobufUnittest_OneOfContainer {
case option4(Int32)

fileprivate var isInitialized: Bool {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch self {
case .option1(let v): return v.isInitialized
case .option2(let v): return v.isInitialized
case .option3(let v): return v.isInitialized
case .option1: return {
guard case .option1(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
case .option2: return {
guard case .option2(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
case .option3: return {
guard case .option3(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
default: return true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,22 @@ struct ProtobufUnittest_OneOfContainer {
case option4(Int32)

fileprivate var isInitialized: Bool {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch self {
case .option1(let v): return v.isInitialized
case .option2(let v): return v.isInitialized
case .option3(let v): return v.isInitialized
case .option1: return {
guard case .option1(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
case .option2: return {
guard case .option2(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
case .option3: return {
guard case .option3(let v) = self else { preconditionFailure() }
return v.isInitialized
}()
default: return true
}
}
Expand Down

0 comments on commit 0803e98

Please sign in to comment.