Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
A msg variant declared without fields, like `Ping -> u256`, could be
matched as a bare `Ping` in a named recv block, but its path `M::Ping`
was rejected as "expected unit variant" because the variant lowers to a
record struct, so it needed `M::Ping {}`. A path pattern naming a msg
variant without fields now matches it like a unit variant. Other records
and msg variants with fields still need their braces.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b398d018c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && ty.adt_def(self.db).is_some_and(|adt_def| { | ||
| matches!(adt_def.adt_ref(self.db), AdtRef::Struct(struct_) | ||
| if implements_msg_variant(self.db, struct_)) |
There was a problem hiding this comment.
Preserve type arguments when checking message variants
When a zero-field variant is generic (for example, a manually supported Empty<u8> with a MsgVariant<Sol> impl), this leaves fieldless_msg_variant false. The resolved ty contains u8, but implements_msg_variant receives only the Struct and reconstructs the unapplied, higher-kinded TyId::adt, which cannot unify with an impl whose self type is Empty<u8> (or Empty<T>). Such variants therefore still emit “expected unit variant” instead of gaining the path-only matching behavior added here; check the actual resolved type rather than discarding its arguments.
Useful? React with 👍 / 👎.
|
from the agents:
|
A msg variant declared without fields, like
Ping -> u256, could be matched as a barePingin a named recv block, but its pathM::Pingwas rejected with "expected unit variant" and had to be writtenM::Ping {}. A path pattern naming a fieldless msg variant now matches it like a unit variant, in named and unnamed recv blocks alike. Other records, and msg variants with fields, still need their braces.