File tree Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Original file line number Diff line number Diff line change @@ -25,37 +25,11 @@ function promote_operation_fallback(
2525 )
2626end
2727
28- _instantiate_zero (:: Type{S} ) where {S} = zero (S)
29- _instantiate_oneunit (:: Type{S} ) where {S} = oneunit (S)
30-
31- # this is valid because Irrational numbers are defined in global scope as const
32- _instantiate (:: Type{S} ) where {S<: Irrational } = S ()
33- _instantiate_zero (:: Type{S} ) where {S<: AbstractIrrational } = _instantiate (S)
34- _instantiate_oneunit (:: Type{S} ) where {S<: AbstractIrrational } = _instantiate (S)
35-
36- # Julia v1.0.x has trouble with inference with the `Vararg` method, see
37- # https://travis-ci.org/jump-dev/JuMP.jl/jobs/617606373
38- function promote_operation_fallback (
39- op:: Union{typeof(/),typeof(div)} ,
40- :: Type{S} ,
41- :: Type{T} ,
42- ) where {S,T}
43- return typeof (op (_instantiate_zero (S), _instantiate_oneunit (T)))
44- end
45-
46- function promote_operation_fallback (
47- op:: F ,
48- :: Type{S} ,
49- :: Type{T} ,
50- ) where {F<: Function ,S,T}
51- return typeof (op (_instantiate_zero (S), _instantiate_zero (T)))
52- end
53-
5428function promote_operation_fallback (
5529 op:: F ,
5630 args:: Vararg{Type,N} ,
5731) where {F<: Function ,N}
58- return typeof ( op ( _instantiate_zero .( args) ... ) )
32+ return promote_type ( args... )
5933end
6034
6135promote_operation_fallback (:: typeof (* ), :: Type{T} ) where {T} = T
You can’t perform that action at this time.
0 commit comments