Do not report missing Root
or init_root
in component macro
#314
Labels
good first issue
Good for newcomers
Root
or init_root
in component macro
#314
In the
component_empty
example (and others), we report that theRoot
type and theinit_root
function are missing:Relm4/relm4-macros/tests/ui/compile-fail/component-empty.stderr
Lines 18 to 20 in 15d1205
However, these are provided by the macro if they're not present, so we should not ask the user to provide them. Instead, the expansion should always provide values for them, even if there isn't enough information provided to actually determine the real values.
init_root
can just expand tofn init_root() -> Self::Root { unimplemented!() }
. TheRoot
type is a bit harder: we can't use!
orstd::convert::Infallible
, because the necessary traits aren't implemented. Instead we could default it toEmptyRoot
or an arbitrary gtk widget. We must only do this if we are sure that the expansion will fail for another reason, though.The text was updated successfully, but these errors were encountered: