-
Notifications
You must be signed in to change notification settings - Fork 431
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
Fix trait message return type metadata #1531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick turnaround ⚡
} | ||
|
||
#[test] | ||
fn trait_message_metadata_return_value_is_result() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of completeness, we may also want to add tests for inherent messages, inherent fallible messages, etc.
Right now as long as the tests inlang-err-integration-tests
work our metadata stuff is probably fine, but it would be nice to be more explicit with our checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, we need more tests for the metadata like this. Work for a follow-on PR methinks.
* Add failing message return type metadata test * Set wrapped return type for trait message * Combine existing contractor metadata test * Common extract result function * Refactor fallible constructor test to use helpers * Remove dummy test * Fix clippy warning
Follow up to #1450, addresses the metadata part of #1530.
Messages now return
Result<_, LangError>
. The metadata was updated to reflect this for inherent methods but not for trait methods.Note that as mentioned in the #1530, this only fixes the external metadata, and does not address the codegen for cross contract calling.
Additionally this PR copies a similar test for fallible constructor metadata from one of the compile tests, and allows it to use the helpers for extracting result types here.