Skip to content

Commit 37efaf6

Browse files
authored
Mark the legacy _NameMap initializer as deprecated. (#1816)
No one calls these directly, but the old generated code code. This will hopefully nudge folks to regenerate their sources to take advantage of the newer generation that comes from smaller codegen and has some better memory overhead during startup.
1 parent 044207d commit 37efaf6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/SwiftProtobuf/NameMap.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ public struct _NameMap: ExpressibleByDictionaryLiteral {
304304
#else // !REMOVE_LEGACY_NAMEMAP_INITIALIZERS
305305

306306
/// Build the bidirectional maps between numbers and proto/JSON names.
307+
@available(
308+
*,
309+
deprecated,
310+
message: "Please regenerate your .pb.swift files with the current version of the SwiftProtobuf protoc plugin."
311+
)
307312
public init(
308313
reservedNames: [String],
309314
reservedRanges: [Range<Int32>],
@@ -316,6 +321,11 @@ public struct _NameMap: ExpressibleByDictionaryLiteral {
316321
}
317322

318323
/// Build the bidirectional maps between numbers and proto/JSON names.
324+
@available(
325+
*,
326+
deprecated,
327+
message: "Please regenerate your .pb.swift files with the current version of the SwiftProtobuf protoc plugin."
328+
)
319329
public init(dictionaryLiteral elements: (Int, NameDescription)...) {
320330
initHelper(elements)
321331
}

0 commit comments

Comments
 (0)