[lang2/macro] improve error message for unknown method ink! markers

The error diagnostics can be further improved by showing all occurences of unknown ink! markers in an impl block.
parent 1021aab6
...@@ -386,7 +386,7 @@ impl TryFrom<syn::ImplItemMethod> for ir::Function { ...@@ -386,7 +386,7 @@ impl TryFrom<syn::ImplItemMethod> for ir::Function {
selector: ir::FunctionSelector::from(&method.sig.ident), selector: ir::FunctionSelector::from(&method.sig.ident),
})) }))
} }
unknown => Err(format_err!(unknown, "unknown ink! attribute found",)), _unknown => Err(format_err_span!(attr.span(), "unknown ink! marker",)),
}?; }?;
if kind == ir::FunctionKind::Method { if kind == ir::FunctionKind::Method {
kind = new_kind; kind = new_kind;
...@@ -394,7 +394,7 @@ impl TryFrom<syn::ImplItemMethod> for ir::Function { ...@@ -394,7 +394,7 @@ impl TryFrom<syn::ImplItemMethod> for ir::Function {
} else { } else {
Err(format_err_span!( Err(format_err_span!(
attr.span(), attr.span(),
"conflicting ink! attribute found", "conflicting ink! marker",
)) ))
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment