fast-nail-55400
08/11/2021, 2:04 PMTarget
subclass to some other non-target type if there is a rule defined for that conversion? can it do so if the rule is defined to take an applicable FieldSet as input and returns the destination type?witty-crayon-22786
08/11/2021, 4:06 PMis the engine able to convert from ayes: if you have a rulesubclass to some other non-target type if there is a rule defined for that conversion?Target
convert_my_target(…: MyTarget) -> NonTargetType
it would be invoked.
can it do so if the rule is defined to take an applicable FieldSet as input and returns the destination type?i don’t see why not.
Target
subtypes are not provided by any rule in the graph currently, so you’d have to actually do the cast yourself and then await Get (NonTargetType, MyTarget(..))
hundreds-father-404
08/11/2021, 4:49 PMmaybe your question is rooted in the subtyping bit though?Maybe what you mean: @fast-nail-55400 one thing to be aware of is how the engine uses exact type IDs and does not respect subclassing. A rule that takes
Target
won't work because nothing in the repo has the type ID of Target
. This is why we have WrappedTarget
and field sets etc