-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add compile error for associated_to attribute #206
Add compile error for associated_to attribute #206
Conversation
916323c
to
137179d
Compare
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.
Nice!
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.
One small piece of feedback around the error message.
Want to change it and update the tests to pass with the new message?
Then you can squash and merge.
Thanks!
EDIT - oh and when you squash and merge please remember to paste in the commit message from your PR body. Thanks!
@@ -206,6 +208,12 @@ struct {struct_name}; | |||
let message = format!(r#"Only `extern` blocks, structs and enums are supported."#); | |||
Error::new_spanned(item, message) | |||
} | |||
ParseError::InvalidAssociatedTo { self_ } => { | |||
let message = format!( | |||
r#"The associated_to attribute is used for only an associated method."# |
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.
The associated_to attribute can only be used on static methods.
Great commit message by the way, thanks. Just one note:
|
137179d
to
6a1c528
Compare
This commit adds support for generating a compile error message when using
#[swift_bridge(associated_to = OpaqueRustType)]
on instance methods.Related to #179.
Will generate the following error: