Skip to content

Conversation

@yordis
Copy link
Contributor

@yordis yordis commented Jan 10, 2026

Add __protobuf__: true marker to all protobuf message structs and create an is_protobuf_message/1 guard macro, following Elixir's convention for is_exception/1. This enables efficient, idiomatic checking of protobuf messages in guards and pattern matching.

Signed-off-by: Yordis Prieto yordis.prieto@gmail.com

@yordis yordis marked this pull request as ready for review January 10, 2026 06:19
Add __protobuf__: true marker to all protobuf message structs and create an is_protobuf_message/1 guard macro, following Elixir's convention for is_exception/1. This enables efficient, idiomatic checking of protobuf messages in guards and pattern matching.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the yordis/is-proto-message branch from 35bb03e to 99f290e Compare January 10, 2026 06:20
@yordis
Copy link
Contributor Author

yordis commented Jan 10, 2026

I came across few times where I want to ensure protos are passed down. With latest Elixir typecheck, hopefully this guard helps even more.

@yordis
Copy link
Contributor Author

yordis commented Jan 13, 2026

@whatyouhide another one for you 😄

@whatyouhide whatyouhide merged commit 5900252 into elixir-protobuf:main Jan 19, 2026
4 checks passed
@whatyouhide
Copy link
Collaborator

Thank you @yordis 🫶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants