Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate marker protocols with @_marker #1497

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/Message.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public protocol Message: _MessageBase {
#if DEBUG
public protocol _MessageBase: Sendable, CustomDebugStringConvertible {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not also in DEBUG builds?

Copy link
Contributor Author

@mjburghard mjburghard Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They cannot inherit from non-marker protocols.

CustomDebugStringConvertible is not a marker protocol.

#else
public protocol _MessageBase: Sendable {}
@_marker public protocol _MessageBase: Sendable {}
#endif

extension Message {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/ProtobufAPIVersionCheck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/// `Version.compatibilityVersion` in `protoc-gen-swift`. That version and this
/// version must match for the generated protos to be compatible, so if you
/// update one, make sure to update it here and in the associated type below.
public protocol ProtobufAPIVersion_3 {}
@_marker public protocol ProtobufAPIVersion_3 {}

/// This protocol is expected to be implemented by a `fileprivate` type in each
/// source file emitted by `protoc-gen-swift`. It effectively creates a binding
Expand Down