You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really know a good way of going about this. Perhaps we should just add a method to operate!!(op::typeof(MutableArithmetics.add_mul), x::Vector{VariableRef}, args::VariableRef)? We can't do it at the MA level, because there might be types that do support vector + scalar.
I think the issue is promote_operation. We could try using promote_op and only resort to the fallback in case promote_op does not return something concrete. I was discussing this with @vchuravy at the JuliaCon and it seems the takeaway was that promote_op is undecidable (like the HALT problem) and promote_op wants to always terminate so it has to give away something. So it guarantees to always return a supertype but it's not always the tightest possible supertype. For MA, we always want a concrete type so that's why we cannot completely rely on promote_op but in the case where promote_op does return a concrete type then we can just use it.
I also discussed this with @schlichtanders after the IsDef.jl talk as IsDef.Out is trying to achieve the same goal as promote_operation, see: https://www.youtube.com/watch?v=2QLJOQNiZhI&t=1765s
https://discourse.julialang.org/t/methoderror-no-method-matching-zero-type-vector-affexpr/105639
The text was updated successfully, but these errors were encountered: