Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
764 commits
Select commit Hold shift + click to select a range
36d5b6e
Formatting
gjcairo May 30, 2024
df0b3e7
Merge pull request #1612 from gjcairo/make-non-breaking-errors
thomasvl Jun 3, 2024
17dca5d
Add back removed API and undo renames
gjcairo Apr 5, 2024
a8a0bf8
Add disfavored overloads for Foundation.ContiguousBytes
gjcairo Apr 8, 2024
2f9e164
Add missing init for any.pb
gjcairo Apr 12, 2024
502d3c1
Fix recent changes
gjcairo May 13, 2024
01d9a5c
Regenerate
gjcairo May 13, 2024
226e796
Regenerate
gjcairo Jun 4, 2024
7b5ca11
Formatting
gjcairo Jun 5, 2024
7c823e2
Fix FuzzBinary/main.swift
gjcairo Jun 5, 2024
bf61972
Rename arguments back from contiguousBytes to serializedBytes
gjcairo Jun 5, 2024
8feb2cf
Use serializedBytes funcs in tests
gjcairo Jun 5, 2024
f6e7809
PR changes
gjcairo Jun 5, 2024
d09ddd2
Formatting
gjcairo Jun 5, 2024
94f0487
Merge pull request #1654 from gjcairo/unbreak-removed
FranzBusch Jun 6, 2024
26430d3
Change API version back to 2
gjcairo Apr 12, 2024
2cca8e8
Regenerate protos
gjcairo Apr 12, 2024
960931b
Ignore wrongful sendability API breaks
gjcairo Jun 6, 2024
7d876ad
Merge pull request #1660 from gjcairo/apiv3-revert
Lukasa Jun 6, 2024
3ecce91
Move CI from 5.10.0 to 5.10.1.
thomasvl Jun 7, 2024
66cff0e
Fix handling of map fields inheriting DELIMITED
mkruskal-google Jun 10, 2024
b7eb991
Update reference file
mkruskal-google Jun 11, 2024
4d7fb41
Switch type to a private-set var
mkruskal-google Jun 11, 2024
0595151
Merge pull request #1663 from mkruskal-google/delimited-fix
tbkka Jun 12, 2024
c01e919
Update proto files form upstream.
thomasvl Jun 17, 2024
b22f919
Update lifeline/default info to match what protoc needs.
thomasvl Jun 17, 2024
de2ea22
Regenerate
thomasvl Jun 17, 2024
4429458
Undo breaking changes in SwiftProtobufPluginLibrary
gjcairo Jun 25, 2024
d8e26f2
Fix a few other missing changes
gjcairo Jun 25, 2024
835c55c
PR changes
gjcairo Jun 25, 2024
ac31b5c
Few more PR changes
gjcairo Jun 25, 2024
7201e81
Merge pull request #1666 from gjcairo/breaking-changes-plugin-lib
thomasvl Jun 26, 2024
c257143
Update API breakage GH actions to run for SwiftProtobufPluginLibrary too
gjcairo Jun 27, 2024
5c8c836
Update proto files from upstream.
thomasvl Jun 27, 2024
e8ea41b
Regenerate.
thomasvl Jun 27, 2024
e68412d
Fix missed update when we went back to one podspec.
thomasvl Jul 8, 2024
d57a5ae
Move `main` to 1.27.0
thomasvl Jul 8, 2024
b4d353b
Update the api check.
thomasvl Jul 8, 2024
e0fe1c4
Move api check to just against main.
thomasvl Jul 8, 2024
7dafe3d
Revert "Use older base image for sanitizer and fuzz testing."
thomasvl Jul 8, 2024
4668914
Update the CI swift images.
thomasvl Jul 8, 2024
10101e5
Update README.md
Archish27 Jul 9, 2024
711179a
Fix typos in deprecation messages
gjcairo Jul 9, 2024
37dc651
Merge pull request #1674 from Archish27/patch-1
tbkka Jul 9, 2024
601e03a
Let CodeGenerators provide extension for CustomOptions.
thomasvl Jul 15, 2024
bedea25
Fix FuzzTests unit tests
gjcairo Jul 23, 2024
e17d61f
Version bump for a release.
thomasvl Jul 23, 2024
424aa33
Update CodeGenerator.swift
lamtrinhdev Jul 24, 2024
fccf179
Update CommandLine+Extensions.swift
lamtrinhdev Jul 24, 2024
56c0a13
Update STYLE_GUIDELINES.md
lamtrinhdev Jul 24, 2024
8202ca5
Update Package.swift
lamtrinhdev Jul 24, 2024
103cf91
Merge pull request #1682 from lamtrinhdev/Fix_links
thomasvl Jul 25, 2024
0a4961c
Update AnyMessageStorage.swift
lamtrinhdev Jul 25, 2024
052f941
Update AnyMessageStorage.swift
lamtrinhdev Jul 25, 2024
22a869c
Update AsyncMessageSequence.swift
lamtrinhdev Jul 25, 2024
866b6d5
Update AsyncMessageSequence.swift
lamtrinhdev Jul 25, 2024
6c66cc4
Update AsyncMessageSequence.swift
lamtrinhdev Jul 25, 2024
4ea80c0
Update BinaryDecodingOptions.swift
lamtrinhdev Jul 25, 2024
1764b91
Update BinaryEncodingOptions.swift
lamtrinhdev Jul 25, 2024
e1a6f51
Update BinaryEncodingOptions.swift
lamtrinhdev Jul 25, 2024
3b7f8c0
Update JSONEncoder.swift
lamtrinhdev Jul 25, 2024
e2f2964
Update JSONEncodingOptions.swift
lamtrinhdev Jul 25, 2024
558efa1
Update JSONScanner.swift
lamtrinhdev Jul 25, 2024
30656d7
Update JSONScanner.swift
lamtrinhdev Jul 25, 2024
58fc973
Update JSONEncoder.swift
lamtrinhdev Jul 25, 2024
c775f5a
Merge pull request #1684 from lamtrinhdev/Fix_comments
tbkka Jul 25, 2024
b9694b1
Add two extensions for the MessageSet fuzz testing.
thomasvl Jul 25, 2024
eeb8e13
Regenerate
thomasvl Jul 25, 2024
3a38104
Update the fuzz dictionaries.
thomasvl Jul 25, 2024
b842955
Range check timestamps on all parsing paths.
thomasvl Jul 29, 2024
5825c42
Update README.md
lamtrinhdev Jul 30, 2024
75b2b0e
Merge pull request #1687 from lamtrinhdev/Enhance_README.md
tbkka Jul 30, 2024
b91ba22
Add a plugin api for extracting back out the descriptor proto.
thomasvl Aug 12, 2024
1bd242e
Rename CI checkout directory from main to swift-protobuf
gjcairo Aug 12, 2024
cdc3b1f
Update tools version in PluginExamples Package.swift
gjcairo Aug 12, 2024
259bf67
Change directory name in more jobs
gjcairo Aug 12, 2024
322f814
introduce "UseAccessLevelOnImports" generator option to support acces…
Skoti Jul 24, 2024
bed8eb0
base the default behavior of UseAccessLevelOnImports on Swift version…
Skoti Aug 4, 2024
f0d3542
fix Swift 5.8 compilation as it doesn't implement `if` and `switch` e…
Skoti Aug 5, 2024
3f34c41
add PluginExample for UseAccessLevelOnImports option
Skoti Aug 12, 2024
36b9ddc
Merge pull request #1683 from Skoti/feature/access-level-on-imports
thomasvl Aug 13, 2024
b0f2ddd
Disable swiftlint AND swift-format checking
tbkka Apr 16, 2024
967b423
Rebuild reference files
tbkka Aug 13, 2024
faf05e8
Merge pull request #1627 from tbkka/tbkka-swiftlint-disable-all
thomasvl Aug 14, 2024
e3d01ea
Fix comments
Aug 15, 2024
3a4c97d
Merge pull request #1505 from pouyayarandi/add-proto-reflection
tbkka Aug 16, 2024
0803276
add documentation
pouyayarandi Aug 17, 2024
e18338e
Update API.md
pouyayarandi Aug 17, 2024
3006aa9
Add fieldmask example
pouyayarandi Aug 17, 2024
816d598
fix comments
pouyayarandi Aug 23, 2024
5a2daa5
remove `allow developers to ...` in sentences
pouyayarandi Aug 23, 2024
287f09b
Merge pull request #1693 from pouyayarandi/fieldmask-documentation
tbkka Aug 23, 2024
97c8dbd
Regenerate the generated_swift_names_*.protos
thomasvl Aug 23, 2024
09a67b6
Flatten some of the test protos
thomasvl Aug 23, 2024
1a4d15c
Pin docc to a version that works for older swift versions.
thomasvl Aug 23, 2024
ee2fefc
Remove an option not needed for SwiftProtobuf testing.
thomasvl Aug 23, 2024
0e46730
Break the tests dependency on the compiler plugin proto.
thomasvl Aug 23, 2024
aeaac78
Update proto files from upstream.
thomasvl Aug 23, 2024
6c52032
Regenerate
thomasvl Aug 23, 2024
564597a
Version bump for a release.
thomasvl Aug 23, 2024
fef831d
Move some other tests off descriptor.proto.
thomasvl Aug 26, 2024
be11d18
Fix Foundation import's access level in generated code
gjcairo Aug 28, 2024
58db47c
Less generation when no messages, enums, or extensions.
thomasvl Aug 28, 2024
14c7471
Only import Foundation if there is a bytes field.
thomasvl Aug 28, 2024
237a664
Regenerate for the change.
thomasvl Aug 28, 2024
f3b1a7d
Missed comments on https://github.com/apple/swift-protobuf/pull/1704.
thomasvl Aug 29, 2024
788f1b0
Revert "Pin docc to a version that works for older swift versions."
thomasvl Aug 29, 2024
17f45aa
Revise empty file support for `import public`
thomasvl Aug 29, 2024
edb6ed4
Version bump for a release.
thomasvl Aug 30, 2024
beeb414
Make README clearer about `serializedBytes()`
gjcairo Sep 3, 2024
e9def03
Add CompileTests for InternalImportsByDefault (#1709)
gjcairo Sep 5, 2024
dea247b
Change default of useAccessLevelOnImports to always be false
gjcairo Sep 9, 2024
5886254
Copy the formatting related files from swift-nio.
thomasvl Sep 9, 2024
ac8da77
Run `swift-format -p -r -i .`
thomasvl Sep 9, 2024
25381e8
Add a blame ignore for the formatting.
thomasvl Sep 9, 2024
6771068
Update proto files from upstream.
thomasvl Sep 11, 2024
53f361e
Regenerate.
thomasvl Sep 11, 2024
f386b4a
Update the generated_swift_names_* files.
thomasvl Sep 11, 2024
79cd72d
Silence a warning when using Xcode 16/Swift6 toolchain.
thomasvl Sep 20, 2024
ba68a8e
Add Swift 6 toolchains to CI.
thomasvl Sep 20, 2024
10ed2c6
Replace `forEach` with loops.
thomasvl Sep 23, 2024
e1c4ca3
Remove unneeded returns.
thomasvl Sep 23, 2024
bc9606d
Drop docc dep.
thomasvl Sep 23, 2024
c67ed66
Correct wording for Xcode.
lamtrinhdev Sep 24, 2024
551675b
Merge pull request #1721 from thomasvl/format_fixes
thomasvl Sep 24, 2024
c9fbc33
Add two more formatting fixes to the blame ignore.
thomasvl Sep 24, 2024
799b56e
Allow block comments for the table in the code.
thomasvl Sep 24, 2024
546ada4
Resolve some more swift-format lint issues.
thomasvl Sep 25, 2024
398a6f9
Update proto files from upstream.
thomasvl Sep 25, 2024
53aee19
Regenerate.
thomasvl Sep 25, 2024
a692f65
Move the 6.0 workflows to 6.0.1.
thomasvl Sep 25, 2024
ebc7251
Version bump for a release.
thomasvl Oct 2, 2024
4782e2f
Add a swift-format check to run on PRs.
thomasvl Sep 20, 2024
2c22056
Update protobuf build based on current cmake docs.
thomasvl Nov 11, 2024
b164ab2
Swap String(bytes:encoding:)! for String(decoding:as:)
thomasvl Nov 11, 2024
b994cfd
Move 6.0.x to 6.0.2.
thomasvl Nov 11, 2024
96d4542
Strip file-level comment changes during editions codegen tests
mkruskal-google Nov 20, 2024
90b174e
Simplify if statement
mkruskal-google Nov 20, 2024
7a3fbf4
Fix accidentally inverted if statement
mkruskal-google Nov 20, 2024
952160b
Merge pull request #1731 from thomasvl/string_decoding_as
Lukasa Nov 21, 2024
cfb2fd5
Update CI to Swift 6.0.3 (#1736)
thomasvl Dec 13, 2024
43bc712
Update release.yml (#1738)
FranzBusch Dec 18, 2024
f554d76
Update protos from upstream (#1739)
thomasvl Jan 2, 2025
8d33562
Use Swift 6 mode on the plugin examples to ensure generated code comp…
thomasvl Jan 7, 2025
8208b8d
Document some new tests a failing. (#1741)
thomasvl Jan 7, 2025
e876103
During JSON parsing, validate `@type` to be minimally valid. (#1742)
thomasvl Jan 8, 2025
881a549
Split the Package.swift files for CompileTests. (#1743)
thomasvl Jan 13, 2025
e4c3a0c
Build out the validation of google.protobuf.Any JSON support. (#1744)
thomasvl Jan 13, 2025
e9b49af
Add conversions between `Swift.Duration` and `Google_Protobuf_Duratio…
allevato Jan 15, 2025
42195e7
Add availability guards to `Duration` conversion tests. (#1746)
allevato Jan 15, 2025
035c0c4
Add a initializer to Google_Protobuf_Duration with rounding control. …
thomasvl Jan 23, 2025
72708c4
Require Semantic Version labels on PR (#1749)
FranzBusch Jan 24, 2025
c4a2ec0
Add a initializer to Google_Protobuf_Timestamp with rounding control …
thomasvl Jan 28, 2025
f79accc
add visionos to podspec (#1752)
grachyov Feb 4, 2025
4f6e091
Cleaned up generated code for closed Enums (#1751)
nicked Feb 5, 2025
683e459
Update protos file, generated files, and record a new conformance tes…
thomasvl Feb 6, 2025
eb17584
Update MessageSet decoding to only take the first values.
thomasvl Feb 11, 2025
101ecdb
Support reading raw extension fields in a MessageSet. (#1755)
thomasvl Feb 12, 2025
d72aed9
Version bump for a release (#1757)
thomasvl Feb 24, 2025
b3df4c3
Update the RELEASING docs to cover the current state of things. (#1759)
thomasvl Mar 3, 2025
e4dcf71
Deprecate FieldDescriptor.isOptional. (#1764)
thomasvl Mar 25, 2025
9d469c6
Move off `label` and use `isRepeated`/`isRequired`. (#1765)
thomasvl Mar 25, 2025
dd2b330
Deprecate `FieldDescriptor` `label` (#1766)
thomasvl Mar 25, 2025
30092b0
Swift 6.1 on CI (#1768)
thomasvl Apr 1, 2025
7407bce
Track some more upstream changes moving off `label`. (#1769)
thomasvl Apr 8, 2025
1589dc3
Update protos from upstream and record new conformance failure (#1772)
thomasvl May 8, 2025
187b938
Some small cleanups. (#1773)
thomasvl May 9, 2025
e41d3f0
Drop Swift 5.9 (#1775)
rnro May 14, 2025
60153e3
Support TextFormat skipping reserved field names and numbers.
thomasvl May 16, 2025
e77d6e5
Like the plugin, use `.rawValue` (#1779)
thomasvl May 22, 2025
102a647
Version bump to prep for a release (#1781)
thomasvl May 27, 2025
90fddae
Use 6.1.2 on CI (#1783)
thomasvl May 28, 2025
b83e38c
Now that 5.10 is the baseline, remove some old bits/refs. (#1788)
thomasvl May 29, 2025
afd9ddf
Remove the 5.9 comments. (#1786)
thomasvl May 30, 2025
722ca14
Move two of the tests off `@testable import` (#1785)
thomasvl Jun 9, 2025
477f325
use `package` visibility for an internal helper. (#1790)
thomasvl Jun 9, 2025
a2f2b46
As of Swift 5.9 `Data` was `Sendable`, so remove `@unchecked` use. (#…
thomasvl Jun 9, 2025
7f94e23
Move SwiftProtobufTests to using `package` visibility. (#1791)
thomasvl Jun 12, 2025
77f2113
Capture known failures. (#1799)
thomasvl Jun 23, 2025
0f043ac
Create a bytecode interpreter to compactly represent text/JSON name m…
allevato Jun 27, 2025
4baa7dc
One reference missed in the NameMap changes. (#1802)
thomasvl Jun 27, 2025
eeecdc2
Update proto files from upstream. (#1803)
thomasvl Jun 30, 2025
27d8bb9
Inline the bytecode string into the `_NameMap.init(bytecode:)` call. …
allevato Jun 30, 2025
b8f52f8
Create fewer temporary `String`s when computing JSON names. (#1807)
allevato Jun 30, 2025
a0c68e0
Prune `nameString` to reduce runtime size of `Name` (#1806)
thomasvl Jul 2, 2025
c345fd3
Enable the blocking of legacy _NameMap support. (#1805)
thomasvl Jul 2, 2025
5c51f31
Use unchecked math operations. (#1809)
thomasvl Jul 14, 2025
0ed8a93
Tweak Protos layout and update proto files (#1810)
thomasvl Jul 15, 2025
214b052
Remove the use of `lazy`, `unverified_lazy`, and `ctype` in test file…
thomasvl Jul 16, 2025
e9aba0c
Remove one more place ctype was used that got missed (#1812)
thomasvl Jul 16, 2025
dd5a9bc
Put a proto package on the test file. (#1813)
thomasvl Jul 17, 2025
3037b9b
Support blocking deprecated apis from the runtime. (#1814)
thomasvl Jul 21, 2025
044207d
Fix copy/paste in comment that has the wrong thing. (#1815)
thomasvl Jul 21, 2025
37efaf6
Mark the legacy _NameMap initializer as deprecated. (#1816)
thomasvl Jul 22, 2025
701b7d6
Move the test helpers to `package` visibility. (#1817)
thomasvl Jul 22, 2025
79dfdbc
Drop unneeded argument in build dataset. (#1819)
thomasvl Jul 29, 2025
8053db6
Remove `import Swift`, doesn't seem to be needed. (#1820)
thomasvl Jul 31, 2025
e1e5eff
Add expected failures for the new conformance test issues. (#1822)
thomasvl Aug 5, 2025
30a4f73
Validate Timestamp before generating JSON to match upstream. (#1824)
thomasvl Aug 6, 2025
75aac0f
Validate Duration before generating JSON to match upstream. (#1823)
thomasvl Aug 6, 2025
aac051b
Support "edition2024". (#1825)
thomasvl Aug 7, 2025
c7a162b
Update protos from upstream. (#1826)
thomasvl Aug 7, 2025
1621046
Per #1830, tweak the phrasing. (#1831)
thomasvl Aug 11, 2025
16a12c8
Bring over the last upstream proto file that was left off last time. …
thomasvl Aug 11, 2025
e5e0c8f
Upload artifact bundle
FranzBusch Aug 12, 2025
5c021bc
Revert "Upload artifact bundle"
FranzBusch Aug 12, 2025
70f9e85
Add automated protoc artifact bundle generation for releases (#1835)
FranzBusch Aug 13, 2025
cb14a0a
Create separate protoc releases (#1837)
FranzBusch Aug 14, 2025
c036968
Fix `make_latest` from Boolean to String (#1838)
FranzBusch Aug 14, 2025
371744e
Add `protoc` product (#1836)
FranzBusch Aug 14, 2025
5bd6528
Improve plugin error handling (#1840)
thomasvl Aug 15, 2025
95d4576
Remove unneeded arguments (#1842)
thomasvl Aug 15, 2025
6ceb2da
Deprecate another helper. (#1841)
thomasvl Aug 18, 2025
e3f69fd
Prepare for a 1.31.0 release and update docs (#1843)
FranzBusch Aug 18, 2025
d9d778c
Add support for our use of `package` visibility. (#1844)
thomasvl Aug 20, 2025
4d9df91
Move from 6.1.2 to 6.1.3 on CI. (#1849)
thomasvl Sep 9, 2025
34a0540
Float the bugfix version. (#1851)
thomasvl Sep 9, 2025
335ea33
Let users opt of fetching protoc (#1850)
glbrntt Sep 10, 2025
2547102
Version bump for a release (#1852)
thomasvl Sep 15, 2025
05f940e
Include Swift 6.2 in the CI config. (#1853)
thomasvl Oct 6, 2025
f8c286a
Be explicit about the type and bound we're checking in `BytecodeReade…
allevato Oct 7, 2025
e2ba53a
Version bump to do a release. (#1860)
thomasvl Oct 7, 2025
86b697a
Add basic RawSpan support for initializing and merging messages (#1857)
pawelmajcher Oct 8, 2025
a7a1a72
Update the protoc release process. (#1863)
thomasvl Oct 8, 2025
857c8dc
Update the protoc artifact. (#1864)
thomasvl Oct 8, 2025
c6fe644
Version bump for a release. (#1865)
thomasvl Oct 8, 2025
60facae
chore: restrict GitHub workflow permissions - future-proof (#1873)
incertum Oct 20, 2025
03a26d1
Update OneofGenerator to support breaking up large switch statements …
pm-dev Oct 20, 2025
ee4eca9
Build `protoc` from source (#1876)
FranzBusch Oct 27, 2025
97bb244
Bump version number (#1878)
FranzBusch Oct 27, 2025
62569b6
Use the new warning control instead of `unsafeFlag`s (#1882)
FranzBusch Oct 29, 2025
55e8dfb
Update versions to 1.33.2 (#1883)
FranzBusch Oct 29, 2025
c169a57
Ignore the abseil privacy manifest and bump the patch version (#1885)
FranzBusch Oct 29, 2025
a42e5ce
Fix a few Makefile references to be self consistent. (#1892)
thomasvl Nov 3, 2025
64dae41
Only force PROTOC on swift 5.10. (#1893)
thomasvl Nov 3, 2025
0126995
Tweak the CI setup some now that `protoc` is built by SwiftPM (#1891)
thomasvl Nov 3, 2025
468d1a2
Move the upstream proto check back to protobuf head. (#1896)
thomasvl Nov 3, 2025
e271b13
Update proto files (#1898)
thomasvl Nov 3, 2025
170b843
Remove no longer needed bits. (#1899)
thomasvl Nov 3, 2025
6867b77
Enable the swift-format lint check. (#1900)
thomasvl Nov 4, 2025
4bd401a
Use implicit returns in generated code (#1894)
glbrntt Nov 4, 2025
01c4572
Make `check-proto-files` fail when things need updatings. (#1902)
thomasvl Nov 4, 2025
a028b77
Optimize the varint size calculations to be branchless. (#1906)
thomasvl Nov 6, 2025
b2e8265
Revise CI running of conformance tests. (#1901)
thomasvl Nov 11, 2025
497da57
Remove redundant branch. (#1909)
thomasvl Nov 12, 2025
f955596
Update proto files (#1914)
thomasvl Nov 17, 2025
f063b2b
Remove the known api breaks. (#1916)
thomasvl Nov 17, 2025
b2d1b0d
Update proto files from upstream. (#1918)
thomasvl Nov 20, 2025
1a50524
Update proto files (#1919)
thomasvl Nov 24, 2025
3cb40bd
Allow for the use of edition unstable in feature resolver (#1922)
rgoldfinger6 Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Deprecate FieldDescriptor.isOptional. (apple#1764)
This is the start of tracking the upstream changes to move away from
Label and the "optional" bit in there. See
protocolbuffers/protobuf#20687 for the start of
it.

Update the comments on isRequired and isRepeated also.
  • Loading branch information
thomasvl authored Mar 25, 2025
commit e4dcf71900ea76d362c74f26e6d312d543d98c1c
13 changes: 7 additions & 6 deletions Sources/SwiftProtobufPluginLibrary/Descriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1092,18 +1092,19 @@ public final class FieldDescriptor {
/// optional/required/repeated
public let label: Google_Protobuf_FieldDescriptorProto.Label

/// Shorthand for `label` == `.required`.
///
/// NOTE: This could also be a map as the are also repeated fields.
/// Whether or not the field is required. For proto2 required fields and
/// Editions `LEGACY_REQUIRED` fields.
public var isRequired: Bool {
// Implementation comes from FieldDescriptor::is_required()
features.fieldPresence == .legacyRequired
}
/// Shorthand for `label` == `.optional`
public var isOptional: Bool { label == .optional }
/// Shorthand for `label` == `.repeated`
/// Whether or not the field is repeated/map field.
public var isRepeated: Bool { label == .repeated }

/// Use !isRequired() && !isRepeated() instead.
@available(*, deprecated, message: "Use !isRequired() && !isRepeated() instead.")
public var isOptional: Bool { label == .optional }

/// Is this field packable.
public var isPackable: Bool {
// This logic comes from the C++ FieldDescriptor::is_packable() impl.
Expand Down
4 changes: 2 additions & 2 deletions Sources/protoc-gen-swift/MessageGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class MessageGenerator {
"\(e.containingType.fullName) has the option message_set_wire_format but \(e.fullName) is a non message extension field."
return
}
guard e.isOptional else {
guard !e.isRequired && !e.isRepeated else {
errorString =
"\(e.containingType.fullName) has the option message_set_wire_format but \(e.fullName) is not a \"optional\" extension field."
"\(e.containingType.fullName) has the option message_set_wire_format but \(e.fullName) cannot be required nor repeated extension field."
return
}
}
Expand Down