File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,34 @@ function promote_operation_fallback(
4040 :: Type{S} ,
4141 :: Type{T} ,
4242) where {S,T}
43- return typeof (op (_instantiate_zero (S), _instantiate_oneunit (T)))
43+ if isconcretetype (S) && isconcretetype (T)
44+ return typeof (op (_instantiate_zero (S), _instantiate_oneunit (T)))
45+ else
46+ return promote_type (S, T)
47+ end
4448end
4549
4650function promote_operation_fallback (
4751 op:: F ,
4852 :: Type{S} ,
4953 :: Type{T} ,
5054) where {F<: Function ,S,T}
51- return typeof (op (_instantiate_zero (S), _instantiate_zero (T)))
55+ if isconcretetype (S) && isconcretetype (T)
56+ return typeof (op (_instantiate_zero (S), _instantiate_zero (T)))
57+ else
58+ return promote_type (S, T)
59+ end
5260end
5361
5462function promote_operation_fallback (
55- :: F ,
63+ op :: F ,
5664 args:: Vararg{Type,N} ,
5765) where {F<: Function ,N}
58- return typeof (op (_instantiate_zero .(args)... ))
66+ if all (isconcretetype, args)
67+ return typeof (op (_instantiate_zero .(args)... ))
68+ else
69+ return promote_type (args... )
70+ end
5971end
6072
6173promote_operation_fallback (:: typeof (* ), :: Type{T} ) where {T} = T
You can’t perform that action at this time.
0 commit comments