-
Notifications
You must be signed in to change notification settings - Fork 249
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
Implemented syn::Error::combine for ItemImplInfo and ItemTraitInfo #1065
Changes from 4 commits
991e3b6
9b41078
5eca06c
6ff9622
011d2eb
ee22d39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,8 @@ | ||||||
//! Method with non-deserializable argument type. | ||||||
|
||||||
// //! Method with non-deserializable argument type. | ||||||
//This tests also checks whether argument errors gets combined or not. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//faulty_method checks a combination of serialiser and type not not supported | ||||||
//faulty_method1 checks a combination of serialiser and only Identity pattern allowed. | ||||||
//It is not possible to check Identity pattern and Type not supported together. | ||||||
use borsh::{BorshDeserialize, BorshSerialize}; | ||||||
use near_sdk::{near_bindgen, PanicOnDefault}; | ||||||
|
||||||
|
@@ -9,7 +12,8 @@ struct Storage {} | |||||
|
||||||
#[near_bindgen] | ||||||
impl Storage { | ||||||
pub fn insert(&mut self, (a, b): (u8, u32)) {} | ||||||
pub fn faulty_method(&mut self, #[serializer(SomeNonExistentSerializer)] _a: *mut u32) {} | ||||||
pub fn faulty_method1(&mut self, #[serializer(SomeNonExistentSerializer)] (a, b): (u8, u32)) {} | ||||||
} | ||||||
|
||||||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
error: Unsupported serializer type. | ||
--> compilation_tests/invalid_arg_pat.rs:13:1 | ||
| | ||
13 | #[near_bindgen] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the attribute macro `near_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Unsupported contract API type. | ||
--> compilation_tests/invalid_arg_pat.rs:15:37 | ||
| | ||
15 | pub fn faulty_method(&mut self, #[serializer(SomeNonExistentSerializer)] _a: *mut u32) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally, this would highlight |
||
| ^ | ||
|
||
error: Only identity patterns are supported in function arguments. | ||
--> compilation_tests/invalid_arg_pat.rs:12:30 | ||
--> compilation_tests/invalid_arg_pat.rs:16:38 | ||
| | ||
12 | pub fn insert(&mut self, (a, b): (u8, u32)) {} | ||
| ^^^^^^ | ||
16 | pub fn faulty_method1(&mut self, #[serializer(SomeNonExistentSerializer)] (a, b): (u8, u32)) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, this is a possible regression. Previously, the tuple was highlighted here. Now it's the the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, this is a possible regression. Previously, |
||
| ^ |
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.
Clever and succinct!