WithModel
dispatch is too strict, ought accept subtypes
#169
Labels
enhancement
New feature or request
WithModel
dispatch is too strict, ought accept subtypes
#169
GATlab does a trick where it converts a (literally) indexed function, e.g.
compose[myCat](f,g)
, into something Julia can dispatch on:compose(WithModel{MyCat}(myCat), f, g)
. This latter method is programmatically generated by@instance
, but this generated method expects(TheoryInterface.WithModel){$model_type}
. This is too strict: rather it ought accept(TheoryInterface.WithModel){<:$model_type}
. For example, ifmodel_type
is an abstract type, then any particular model one passes will only be a subtype, not an exact match. See below for an example:The text was updated successfully, but these errors were encountered: