@@ -33,10 +33,6 @@ function -(d1::U, d2::U) where U <: SingletonOrArray
33
33
return UnivariateFinite (L, pdf_matrix (d1, L) - pdf_matrix (d2, L))
34
34
end
35
35
36
- # It seems that the restriction `x::Number` below (applying only to the
37
- # array case) is unavoidable because of a method ambiguity with
38
- # `Base.*(::AbstractArray, ::Number)`.
39
-
40
36
function _times (d, x, T)
41
37
S = d. scitype
42
38
decoder = d. decoder
@@ -46,10 +42,10 @@ function _times(d, x, T)
46
42
end
47
43
return T (d. scitype, decoder, prob_given_ref)
48
44
end
49
- * (d:: UnivariateFinite , x) = _times (d, x, UnivariateFinite)
45
+ * (d:: UnivariateFinite , x:: Number ) = _times (d, x, UnivariateFinite)
50
46
* (d:: UnivariateFiniteArray , x:: Number ) = _times (d, x, UnivariateFiniteArray)
51
47
52
- * (x, d:: UnivariateFinite ) = d* x
48
+ * (x:: Number , d:: UnivariateFinite ) = d* x
53
49
* (x:: Number , d:: UnivariateFiniteArray ) = d* x
54
- / (d:: UnivariateFinite , x) = d* inv (x)
50
+ / (d:: UnivariateFinite , x:: Number ) = d* inv (x)
55
51
/ (d:: UnivariateFiniteArray , x:: Number ) = d* inv (x)
0 commit comments