-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes error description and span for closure args
- Loading branch information
Showing
3 changed files
with
61 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 3 additions & 15 deletions
18
substrate/frame/support/test/tests/pallet_ui/call_feeless_invalid_closure_arg2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
error[E0308]: mismatched types | ||
--> tests/pallet_ui/call_feeless_invalid_closure_arg2.rs:18:1 | ||
error: Invalid type: expected `&OriginFor<T>` | ||
--> tests/pallet_ui/call_feeless_invalid_closure_arg2.rs:31:28 | ||
| | ||
18 | #[frame_support::pallet(dev_mode)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `&<T as Config>::RuntimeOrigin` | ||
... | ||
31 | #[pallet::feeless_if(|_: bool| -> bool { true })] | ||
| -------------------------- arguments to this function are incorrect | ||
| | ||
= note: expected type `bool` | ||
found reference `&<T as frame_system::Config>::RuntimeOrigin` | ||
note: closure parameter defined here | ||
--> tests/pallet_ui/call_feeless_invalid_closure_arg2.rs:31:25 | ||
| | ||
31 | #[pallet::feeless_if(|_: bool| -> bool { true })] | ||
| ^^^^^^^ | ||
= note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
| ^^^^ |
14 changes: 2 additions & 12 deletions
14
substrate/frame/support/test/tests/pallet_ui/call_feeless_invalid_closure_arg3.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
error[E0308]: mismatched types | ||
--> tests/pallet_ui/call_feeless_invalid_closure_arg3.rs:32:31 | ||
| | ||
31 | #[pallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })] | ||
| --------------------------------------------- arguments to this function are incorrect | ||
32 | pub fn foo(_: OriginFor<T>, _something: u64) -> DispatchResult { Ok(()) } | ||
| ^^^^^^^^^^ expected `&u32`, found `&u64` | ||
| | ||
= note: expected reference `&u32` | ||
found reference `&u64` | ||
note: closure parameter defined here | ||
error: Invalid pallet::call, feeless_if closure argument must have a reference to the same type as the dispatchable function argument | ||
--> tests/pallet_ui/call_feeless_invalid_closure_arg3.rs:31:43 | ||
| | ||
31 | #[pallet::feeless_if(|_: &OriginFor<T>, _s: &u32| -> bool { true })] | ||
| ^^^^^^^^ | ||
| ^^ |