Skip to content

Commit 05858c4

Browse files
authored
Merge branch 'master' into where
2 parents 6a2d98d + 8fde70d commit 05858c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+880
-498
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Julia does not install anything outside the directory it was cloned into. Julia
185185

186186
Julia can be built for a non-generic architecture by configuring the `ARCH` Makefile variable. See the appropriate section of `Make.inc` for additional customization options, such as `MARCH` and `JULIA_CPU_TARGET`.
187187

188-
For example, to build for Pentium 4, set `MARCH=pentium4` and install the necessary system libraries for linking. On Ubuntu, these may include lib32gfortran3 (also manually call `ln -s /usr/lib32/libgfortran3.so.0 /usr/lib32/libgfortran3.so`) and lib32gcc1, lib32stdc++6, among others.
188+
For example, to build for Pentium 4, set `MARCH=pentium4` and install the necessary system libraries for linking. On Ubuntu, these may include lib32gfortran-6-dev, lib32gcc1, and lib32stdc++6, among others.
189189

190190
You can also set `MARCH=native` for a maximum-performance build customized for the current machine CPU.
191191

base/abstractarray.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ julia> size(A,3,2)
1919
(4, 3)
2020
```
2121
"""
22-
size{T,N}(t::AbstractArray{T,N}, d) = d <= N ? size(t)[d] : 1
23-
size{N}(x, d1::Integer, d2::Integer, dx::Vararg{Integer, N}) =
22+
size(t::AbstractArray{T,N}, d) where {T,N} = d <= N ? size(t)[d] : 1
23+
size(x, d1::Integer, d2::Integer, dx::Vararg{Integer, N}) where {N} =
2424
(size(x, d1), size(x, d2), ntuple(k->size(x, dx[k]), Val{N})...)
2525

2626
"""
@@ -91,7 +91,7 @@ julia> extrema(b)
9191
linearindices(A) = (@_inline_meta; OneTo(_length(A)))
9292
linearindices(A::AbstractVector) = (@_inline_meta; indices1(A))
9393
eltype(::Type{<:AbstractArray{E}}) where {E} = E
94-
elsize{T}(::AbstractArray{T}) = sizeof(T)
94+
elsize(::AbstractArray{T}) where {T} = sizeof(T)
9595

9696
"""
9797
ndims(A::AbstractArray) -> Integer
@@ -824,11 +824,11 @@ isempty(a::AbstractArray) = (_length(a) == 0)
824824

825825
## Conversions ##
826826

827-
convert{T,N }(::Type{AbstractArray{T,N}}, A::AbstractArray{T,N}) = A
828-
convert{T,S,N}(::Type{AbstractArray{T,N}}, A::AbstractArray{S,N}) = copy!(similar(A,T), A)
829-
convert{T,S,N}(::Type{AbstractArray{T }}, A::AbstractArray{S,N}) = convert(AbstractArray{T,N}, A)
827+
convert(::Type{AbstractArray{T,N}}, A::AbstractArray{T,N}) where {T,N } = A
828+
convert(::Type{AbstractArray{T,N}}, A::AbstractArray{S,N}) where {T,S,N} = copy!(similar(A,T), A)
829+
convert(::Type{AbstractArray{T }}, A::AbstractArray{S,N}) where {T,S,N} = convert(AbstractArray{T,N}, A)
830830

831-
convert{T,N}(::Type{Array}, A::AbstractArray{T,N}) = convert(Array{T,N}, A)
831+
convert(::Type{Array}, A::AbstractArray{T,N}) where {T,N} = convert(Array{T,N}, A)
832832

833833
"""
834834
of_indices(x, y)

base/array.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ size(a::Array, d) = arraysize(a, d)
7474
size(a::Vector) = (arraysize(a,1),)
7575
size(a::Matrix) = (arraysize(a,1), arraysize(a,2))
7676
size(a::Array) = (@_inline_meta; _size((), a))
77-
_size{_,N}(out::NTuple{N}, A::Array{_,N}) = out
78-
function _size{_,M,N}(out::NTuple{M}, A::Array{_,N})
77+
_size(out::NTuple{N}, A::Array{_,N}) where {_,N} = out
78+
function _size(out::NTuple{M}, A::Array{_,N}) where _ where M where N
7979
@_inline_meta
8080
_size((out..., size(A,M+1)), A)
8181
end
8282

8383
asize_from(a::Array, n) = n > ndims(a) ? () : (arraysize(a,n), asize_from(a, n+1)...)
8484

8585
length(a::Array) = arraylen(a)
86-
elsize{T}(a::Array{T}) = isbits(T) ? sizeof(T) : sizeof(Ptr)
86+
elsize(a::Array{T}) where {T} = isbits(T) ? sizeof(T) : sizeof(Ptr)
8787
sizeof(a::Array) = elsize(a) * length(a)
8888

8989
function isassigned(a::Array, i::Int...)
@@ -94,15 +94,15 @@ end
9494

9595
## copy ##
9696

97-
function unsafe_copy!{T}(dest::Ptr{T}, src::Ptr{T}, n)
97+
function unsafe_copy!(dest::Ptr{T}, src::Ptr{T}, n) where T
9898
# Do not use this to copy data between pointer arrays.
9999
# It can't be made safe no matter how carefully you checked.
100100
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt),
101101
dest, src, n*sizeof(T))
102102
return dest
103103
end
104104

105-
function unsafe_copy!{T}(dest::Array{T}, doffs, src::Array{T}, soffs, n)
105+
function unsafe_copy!(dest::Array{T}, doffs, src::Array{T}, soffs, n) where T
106106
if isbits(T)
107107
unsafe_copy!(pointer(dest, doffs), pointer(src, soffs), n)
108108
else
@@ -121,9 +121,9 @@ function copy!{T}(dest::Array{T}, doffs::Integer, src::Array{T}, soffs::Integer,
121121
unsafe_copy!(dest, doffs, src, soffs, n)
122122
end
123123

124-
copy!{T}(dest::Array{T}, src::Array{T}) = copy!(dest, 1, src, 1, length(src))
124+
copy!(dest::Array{T}, src::Array{T}) where {T} = copy!(dest, 1, src, 1, length(src))
125125

126-
copy{T<:Array}(a::T) = ccall(:jl_array_copy, Ref{T}, (Any,), a)
126+
copy(a::T) where {T<:Array} = ccall(:jl_array_copy, Ref{T}, (Any,), a)
127127

128128
function reinterpret(::Type{T}, a::Array{S,1}) where T where S
129129
nel = Int(div(length(a)*sizeof(S),sizeof(T)))
@@ -317,14 +317,14 @@ oneunit{T}(x::AbstractMatrix{T}) = _one(oneunit(T), x)
317317

318318
## Conversions ##
319319

320-
convert{T}(::Type{Vector}, x::AbstractVector{T}) = convert(Vector{T}, x)
321-
convert{T}(::Type{Matrix}, x::AbstractMatrix{T}) = convert(Matrix{T}, x)
320+
convert(::Type{Vector}, x::AbstractVector{T}) where {T} = convert(Vector{T}, x)
321+
convert(::Type{Matrix}, x::AbstractMatrix{T}) where {T} = convert(Matrix{T}, x)
322322

323-
convert{T,n}(::Type{Array{T}}, x::Array{T,n}) = x
324-
convert{T,n}(::Type{Array{T,n}}, x::Array{T,n}) = x
323+
convert(::Type{Array{T}}, x::Array{T,n}) where {T,n} = x
324+
convert(::Type{Array{T,n}}, x::Array{T,n}) where {T,n} = x
325325

326-
convert{T,n,S}(::Type{Array{T}}, x::AbstractArray{S, n}) = convert(Array{T, n}, x)
327-
convert{T,n,S}(::Type{Array{T,n}}, x::AbstractArray{S,n}) = copy!(Array{T,n}(size(x)), x)
326+
convert(::Type{Array{T}}, x::AbstractArray{S,n}) where {T,n,S} = convert(Array{T,n}, x)
327+
convert(::Type{Array{T,n}}, x::AbstractArray{S,n}) where {T,n,S} = copy!(Array{T,n}(size(x)), x)
328328

329329
promote_rule{T,n,S}(::Type{Array{T,n}}, ::Type{Array{S,n}}) = Array{promote_type(T,S),n}
330330

base/associative.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ length(v::Union{KeyIterator,ValueIterator}) = length(v.dict)
4141
isempty(v::Union{KeyIterator,ValueIterator}) = isempty(v.dict)
4242
_tt1{A,B}(::Type{Pair{A,B}}) = A
4343
_tt2{A,B}(::Type{Pair{A,B}}) = B
44-
eltype{D}(::Type{KeyIterator{D}}) = _tt1(eltype(D))
45-
eltype{D}(::Type{ValueIterator{D}}) = _tt2(eltype(D))
44+
eltype(::Type{KeyIterator{D}}) where {D} = _tt1(eltype(D))
45+
eltype(::Type{ValueIterator{D}}) where {D} = _tt2(eltype(D))
4646

4747
start(v::Union{KeyIterator,ValueIterator}) = start(v.dict)
4848
done(v::Union{KeyIterator,ValueIterator}, state) = done(v.dict, state)
@@ -318,7 +318,7 @@ function filter(f, d::Associative)
318318
return df
319319
end
320320

321-
eltype{K,V}(::Type{Associative{K,V}}) = Pair{K,V}
321+
eltype(::Type{Associative{K,V}}) where {K,V} = Pair{K,V}
322322

323323
function isequal(l::Associative, r::Associative)
324324
l === r && return true

base/atomics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ julia> x[]
302302
"""
303303
function atomic_min! end
304304

305-
unsafe_convert{T}(::Type{Ptr{T}}, x::Atomic{T}) = convert(Ptr{T}, pointer_from_objref(x))
305+
unsafe_convert(::Type{Ptr{T}}, x::Atomic{T}) where {T} = convert(Ptr{T}, pointer_from_objref(x))
306306
setindex!(x::Atomic{T}, v) where {T} = setindex!(x, convert(T, v))
307307

308308
const llvmtypes = Dict(

base/bitarray.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ end
485485

486486
## Conversions ##
487487

488-
convert{T,N}(::Type{Array{T}}, B::BitArray{N}) = convert(Array{T,N}, B)
489-
convert{T,N}(::Type{Array{T,N}}, B::BitArray{N}) = _convert(Array{T,N}, B) # see #15801
488+
convert(::Type{Array{T}}, B::BitArray{N}) where {T,N} = convert(Array{T,N}, B)
489+
convert(::Type{Array{T,N}}, B::BitArray{N}) where {T,N} = _convert(Array{T,N}, B) # see #15801
490490
function _convert{T,N}(::Type{Array{T,N}}, B::BitArray{N})
491491
A = Array{T}(size(B))
492492
Bc = B.chunks
@@ -496,8 +496,8 @@ function _convert{T,N}(::Type{Array{T,N}}, B::BitArray{N})
496496
return A
497497
end
498498

499-
convert{T,N}(::Type{BitArray}, A::AbstractArray{T,N}) = convert(BitArray{N}, A)
500-
function convert{T,N}(::Type{BitArray{N}}, A::AbstractArray{T,N})
499+
convert(::Type{BitArray}, A::AbstractArray{T,N}) where {T,N} = convert(BitArray{N}, A)
500+
function convert(::Type{BitArray{N}}, A::AbstractArray{T,N}) where N where T
501501
B = BitArray(size(A))
502502
Bc = B.chunks
503503
l = length(B)
@@ -522,7 +522,7 @@ function convert{T,N}(::Type{BitArray{N}}, A::AbstractArray{T,N})
522522
return B
523523
end
524524

525-
function convert{N}(::Type{BitArray{N}}, A::Array{Bool,N})
525+
function convert(::Type{BitArray{N}}, A::Array{Bool,N}) where N
526526
B = BitArray(size(A))
527527
Bc = B.chunks
528528
l = length(B)
@@ -531,8 +531,8 @@ function convert{N}(::Type{BitArray{N}}, A::Array{Bool,N})
531531
return B
532532
end
533533

534-
convert{N}(::Type{BitArray{N}}, B::BitArray{N}) = B
535-
convert{T,N}(::Type{AbstractArray{T,N}}, B::BitArray{N}) = convert(Array{T,N}, B)
534+
convert(::Type{BitArray{N}}, B::BitArray{N}) where {N} = B
535+
convert(::Type{AbstractArray{T,N}}, B::BitArray{N}) where {T,N} = convert(Array{T,N}, B)
536536

537537
reinterpret(::Type{Bool}, B::BitArray, dims::NTuple{N,Int}) where {N} = reinterpret(B, dims)
538538
reinterpret(B::BitArray, dims::NTuple{N,Int}) where {N} = reshape(B, dims)

base/boot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ Task(f::ANY) = ccall(:jl_new_task, Ref{Task}, (Any, Int), f, 0)
294294
# note that there is no actual conversion defined here,
295295
# so the methods and ccall's in Core aren't permitted to use convert
296296
convert(::Type{Any}, x::ANY) = x
297-
convert{T}(::Type{T}, x::T) = x
297+
convert(::Type{T}, x::T) where {T} = x
298298
cconvert{T}(::Type{T}, x) = convert(T, x)
299-
unsafe_convert{T}(::Type{T}, x::T) = x
299+
unsafe_convert(::Type{T}, x::T) where {T} = x
300300

301301
NTuple{N,T} = Tuple{Vararg{T,N}}
302302

base/channels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ function notify_error(c::Channel, err)
380380
end
381381
notify_error(c::Channel) = notify_error(c, get(c.excp))
382382

383-
eltype{T}(::Type{Channel{T}}) = T
383+
eltype(::Type{Channel{T}}) where {T} = T
384384

385385
show(io::IO, c::Channel) = print(io, "$(typeof(c))(sz_max:$(c.sz_max),sz_curr:$(n_avail(c)))")
386386

base/char.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
convert(::Type{Char}, x::UInt32) = reinterpret(Char, x)
44
convert(::Type{Char}, x::Number) = Char(UInt32(x))
55
convert(::Type{UInt32}, x::Char) = reinterpret(UInt32, x)
6-
convert{T<:Number}(::Type{T}, x::Char) = convert(T, UInt32(x))
6+
convert(::Type{T}, x::Char) where {T<:Number} = convert(T, UInt32(x))
77

88
rem{T<:Number}(x::Char, ::Type{T}) = rem(UInt32(x), T)
99

base/complex.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const Complex128 = Complex{Float64}
1818
const Complex64 = Complex{Float32}
1919
const Complex32 = Complex{Float16}
2020

21-
convert{T<:Real}(::Type{Complex{T}}, x::Real) = Complex{T}(x,0)
22-
convert{T<:Real}(::Type{Complex{T}}, z::Complex) = Complex{T}(real(z),imag(z))
23-
convert{T<:Real}(::Type{T}, z::Complex) =
21+
convert(::Type{Complex{T}}, x::Real) where {T<:Real} = Complex{T}(x,0)
22+
convert(::Type{Complex{T}}, z::Complex) where {T<:Real} = Complex{T}(real(z),imag(z))
23+
convert(::Type{T}, z::Complex) where {T<:Real} =
2424
isreal(z) ? convert(T,real(z)) : throw(InexactError())
2525

2626
convert(::Type{Complex}, z::Complex) = z

base/deprecated.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,22 +1220,22 @@ end
12201220
/(r::Use_StepRangeLen_Instead, x::Real) = Use_StepRangeLen_Instead(r.start/x, r.step/x, r.len, r.divisor)
12211221
promote_rule{T1,T2}(::Type{Use_StepRangeLen_Instead{T1}},::Type{Use_StepRangeLen_Instead{T2}}) =
12221222
Use_StepRangeLen_Instead{promote_type(T1,T2)}
1223-
convert{T<:AbstractFloat}(::Type{Use_StepRangeLen_Instead{T}}, r::Use_StepRangeLen_Instead{T}) = r
1224-
convert{T<:AbstractFloat}(::Type{Use_StepRangeLen_Instead{T}}, r::Use_StepRangeLen_Instead) =
1223+
convert(::Type{Use_StepRangeLen_Instead{T}}, r::Use_StepRangeLen_Instead{T}) where {T<:AbstractFloat} = r
1224+
convert(::Type{Use_StepRangeLen_Instead{T}}, r::Use_StepRangeLen_Instead) where {T<:AbstractFloat} =
12251225
Use_StepRangeLen_Instead{T}(r.start,r.step,r.len,r.divisor)
12261226

12271227
promote_rule{F,OR<:OrdinalRange}(::Type{Use_StepRangeLen_Instead{F}}, ::Type{OR}) =
12281228
Use_StepRangeLen_Instead{promote_type(F,eltype(OR))}
1229-
convert{T<:AbstractFloat}(::Type{Use_StepRangeLen_Instead{T}}, r::OrdinalRange) =
1229+
convert(::Type{Use_StepRangeLen_Instead{T}}, r::OrdinalRange) where {T<:AbstractFloat} =
12301230
Use_StepRangeLen_Instead{T}(first(r), step(r), length(r), one(T))
1231-
convert{T}(::Type{Use_StepRangeLen_Instead}, r::OrdinalRange{T}) =
1231+
convert(::Type{Use_StepRangeLen_Instead}, r::OrdinalRange{T}) where {T} =
12321232
Use_StepRangeLen_Instead{typeof(float(first(r)))}(first(r), step(r), length(r), one(T))
12331233

12341234
promote_rule{F,OR<:Use_StepRangeLen_Instead}(::Type{LinSpace{F}}, ::Type{OR}) =
12351235
LinSpace{promote_type(F,eltype(OR))}
1236-
convert{T<:AbstractFloat}(::Type{LinSpace{T}}, r::Use_StepRangeLen_Instead) =
1236+
convert(::Type{LinSpace{T}}, r::Use_StepRangeLen_Instead) where {T<:AbstractFloat} =
12371237
linspace(convert(T, first(r)), convert(T, last(r)), convert(T, length(r)))
1238-
convert{T<:AbstractFloat}(::Type{LinSpace}, r::Use_StepRangeLen_Instead{T}) =
1238+
convert(::Type{LinSpace}, r::Use_StepRangeLen_Instead{T}) where {T<:AbstractFloat} =
12391239
convert(LinSpace{T}, r)
12401240

12411241
reverse(r::Use_StepRangeLen_Instead) = Use_StepRangeLen_Instead(r.start + (r.len-1)*r.step, -r.step, r.len, r.divisor)

base/dft.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ abstract type Plan{T} end
88
import Base: show, summary, size, ndims, length, eltype,
99
*, A_mul_B!, inv, \, A_ldiv_B!
1010

11-
eltype{T}(::Type{Plan{T}}) = T
11+
eltype(::Type{Plan{T}}) where {T} = T
1212

1313
# size(p) should return the size of the input array for p
1414
size(p::Plan, d) = size(p)[d]

base/dict.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ similar(d::Dict{K,V}) where {K,V} = Dict{K,V}()
193193
similar(d::Dict, ::Type{Pair{K,V}}) where {K,V} = Dict{K,V}()
194194

195195
# conversion between Dict types
196-
function convert{K,V}(::Type{Dict{K,V}},d::Associative)
196+
function convert(::Type{Dict{K,V}},d::Associative) where V where K
197197
h = Dict{K,V}()
198198
for (k,v) in d
199199
ck = convert(K,k)
@@ -205,7 +205,7 @@ function convert{K,V}(::Type{Dict{K,V}},d::Associative)
205205
end
206206
return h
207207
end
208-
convert{K,V}(::Type{Dict{K,V}},d::Dict{K,V}) = d
208+
convert(::Type{Dict{K,V}},d::Dict{K,V}) where {K,V} = d
209209

210210
hashindex(key, sz) = (((hash(key)%Int) & (sz-1)) + 1)::Int
211211

base/essentials.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ macro _propagate_inbounds_meta()
2626
end
2727

2828
convert(::Type{Any}, x::ANY) = x
29-
convert{T}(::Type{T}, x::T) = x
29+
convert(::Type{T}, x::T) where {T} = x
3030

3131
convert(::Type{Tuple{}}, ::Tuple{}) = ()
3232
convert(::Type{Tuple}, x::Tuple) = x
33-
convert{T}(::Type{Tuple{Vararg{T}}}, x::Tuple) = cnvt_all(T, x...)
33+
convert(::Type{Tuple{Vararg{T}}}, x::Tuple) where {T} = cnvt_all(T, x...)
3434
cnvt_all(T) = ()
3535
cnvt_all(T, x, rest...) = tuple(convert(T,x), cnvt_all(T, rest...)...)
3636

@@ -149,9 +149,9 @@ ptr_arg_unsafe_convert(::Type{Ptr{Void}}, x) = x
149149

150150
cconvert(T::Type, x) = convert(T, x) # do the conversion eagerly in most cases
151151
cconvert(::Type{<:Ptr}, x) = x # but defer the conversion to Ptr to unsafe_convert
152-
unsafe_convert{T}(::Type{T}, x::T) = x # unsafe_convert (like convert) defaults to assuming the convert occurred
153-
unsafe_convert{T<:Ptr}(::Type{T}, x::T) = x # to resolve ambiguity with the next method
154-
unsafe_convert{P<:Ptr}(::Type{P}, x::Ptr) = convert(P, x)
152+
unsafe_convert(::Type{T}, x::T) where {T} = x # unsafe_convert (like convert) defaults to assuming the convert occurred
153+
unsafe_convert(::Type{T}, x::T) where {T<:Ptr} = x # to resolve ambiguity with the next method
154+
unsafe_convert(::Type{P}, x::Ptr) where {P<:Ptr} = convert(P, x)
155155

156156
reinterpret(::Type{T}, x) where {T} = bitcast(T, x)
157157
reinterpret(::Type{Unsigned}, x::Float16) = reinterpret(UInt16,x)

base/gmp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ end
180180

181181
rem(x::Integer, ::Type{BigInt}) = convert(BigInt, x)
182182

183-
function convert{T<:Unsigned}(::Type{T}, x::BigInt)
183+
function convert(::Type{T}, x::BigInt) where T<:Unsigned
184184
if sizeof(T) < sizeof(Limb)
185185
convert(T, convert(Limb,x))
186186
else
@@ -189,7 +189,7 @@ function convert{T<:Unsigned}(::Type{T}, x::BigInt)
189189
end
190190
end
191191

192-
function convert{T<:Signed}(::Type{T}, x::BigInt)
192+
function convert(::Type{T}, x::BigInt) where T<:Signed
193193
n = abs(x.size)
194194
if sizeof(T) < sizeof(Limb)
195195
SLimb = typeof(Signed(one(Limb)))

base/irrationals.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ promote_rule{T<:Number}(::Type{<:Irrational}, ::Type{T}) = promote_type(Float64,
1313

1414
convert(::Type{AbstractFloat}, x::Irrational) = Float64(x)
1515
convert(::Type{Float16}, x::Irrational) = Float16(Float32(x))
16-
convert{T<:Real}(::Type{Complex{T}}, x::Irrational) = convert(Complex{T}, convert(T,x))
16+
convert(::Type{Complex{T}}, x::Irrational) where {T<:Real} = convert(Complex{T}, convert(T,x))
1717

1818
@pure function convert{T<:Integer}(::Type{Rational{T}}, x::Irrational)
1919
o = precision(BigFloat)

0 commit comments

Comments
 (0)