improve error msg on wrong closure signature (#3467)

This commit is contained in:
thiolliere
2019-08-24 17:41:45 +02:00
committed by Gavin Wood
parent b50596428e
commit a528b7dc56
@@ -35,7 +35,7 @@ use syn::{
},
parse_macro_input,
};
use quote::quote;
use quote::{quote, quote_spanned};
use super::*;
@@ -417,7 +417,16 @@ fn decl_store_extra_genesis(
}
assimilate_require_generic |= ext::expr_contains_ident(&expr.content, traitinstance);
let content = &expr.content;
scall = quote!( ( #content ) );
scall = quote_spanned! { expr.span() =>
let scall: fn(
&mut (
#scrate::sr_primitives::StorageOverlay,
#scrate::sr_primitives::ChildrenStorageOverlay
),
&Self
) = #content;
scall
};
has_scall = true;
},
}