Skip to content

Commit aaa528e

Browse files
committed
Misc files to where syntax
1 parent 10eb7c5 commit aaa528e

12 files changed

+74
-74
lines changed

base/base.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function finalizer(o::ANY, f::ANY)
129129
ccall(:jl_gc_add_finalizer_th, Void, (Ptr{Void}, Any, Any),
130130
Core.getptls(), o, f)
131131
end
132-
function finalizer{T}(o::T, f::Ptr{Void})
132+
function finalizer(o::T, f::Ptr{Void}) where T
133133
@_inline_meta
134134
if isimmutable(T)
135135
error("objects of type ", T, " cannot be finalized")

base/dft.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ export fft, ifft, bfft, fft!, ifft!, bfft!,
2222

2323
const FFTWFloat = Union{Float32,Float64}
2424
fftwfloat(x) = _fftwfloat(float(x))
25-
_fftwfloat{T<:FFTWFloat}(::Type{T}) = T
25+
_fftwfloat(::Type{T}) where {T<:FFTWFloat} = T
2626
_fftwfloat(::Type{Float16}) = Float32
27-
_fftwfloat{T}(::Type{Complex{T}}) = Complex{_fftwfloat(T)}
28-
_fftwfloat{T}(::Type{T}) = error("type $T not supported")
29-
_fftwfloat{T}(x::T) = _fftwfloat(T)(x)
27+
_fftwfloat(::Type{Complex{T}}) where {T} = Complex{_fftwfloat(T)}
28+
_fftwfloat(::Type{T}) where {T} = error("type $T not supported")
29+
_fftwfloat(x::T) where {T} = _fftwfloat(T)(x)
3030

3131
complexfloat(x::StridedArray{Complex{<:FFTWFloat}}) = x
3232
realfloat(x::StridedArray{<:FFTWFloat}) = x
3333

3434
# return an Array, rather than similar(x), to avoid an extra copy for FFTW
3535
# (which only works on StridedArray types).
36-
complexfloat{T<:Complex}(x::AbstractArray{T}) = copy1(typeof(fftwfloat(zero(T))), x)
37-
complexfloat{T<:Real}(x::AbstractArray{T}) = copy1(typeof(complex(fftwfloat(zero(T)))), x)
36+
complexfloat(x::AbstractArray{T}) where {T<:Complex} = copy1(typeof(fftwfloat(zero(T))), x)
37+
complexfloat(x::AbstractArray{T}) where {T<:Real} = copy1(typeof(complex(fftwfloat(zero(T)))), x)
3838

39-
realfloat{T<:Real}(x::AbstractArray{T}) = copy1(typeof(fftwfloat(zero(T))), x)
39+
realfloat(x::AbstractArray{T}) where {T<:Real} = copy1(typeof(fftwfloat(zero(T))), x)
4040

4141
# copy to a 1-based array, using circular permutation
42-
function copy1{T}(::Type{T}, x)
42+
function copy1(::Type{T}, x) where T
4343
y = Array{T}(map(length, indices(x)))
4444
Base.circcopy!(y, x)
4545
end

base/dict.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ end
154154

155155
TP{K,V} = Union{Type{Tuple{K,V}},Type{Pair{K,V}}}
156156

157-
associative_with_eltype{K,V}(DT_apply, kv, ::TP{K,V}) = DT_apply(K, V)(kv)
158-
associative_with_eltype{K,V}(DT_apply, kv::Generator, ::TP{K,V}) = DT_apply(K, V)(kv)
159-
associative_with_eltype{K,V}(DT_apply, ::Type{Pair{K,V}}) = DT_apply(K, V)()
157+
associative_with_eltype(DT_apply, kv, ::TP{K,V}) where {K,V} = DT_apply(K, V)(kv)
158+
associative_with_eltype(DT_apply, kv::Generator, ::TP{K,V}) where {K,V} = DT_apply(K, V)(kv)
159+
associative_with_eltype(DT_apply, ::Type{Pair{K,V}}) where {K,V} = DT_apply(K, V)()
160160
associative_with_eltype(DT_apply, ::Type) = DT_apply(Any, Any)()
161-
associative_with_eltype{F}(DT_apply::F, kv, t) = grow_to!(associative_with_eltype(DT_apply, _default_eltype(typeof(kv))), kv)
162-
function associative_with_eltype{F}(DT_apply::F, kv::Generator, t)
161+
associative_with_eltype(DT_apply::F, kv, t) where {F} = grow_to!(associative_with_eltype(DT_apply, _default_eltype(typeof(kv))), kv)
162+
function associative_with_eltype(DT_apply::F, kv::Generator, t) where F
163163
T = _default_eltype(typeof(kv))
164164
if T <: Union{Pair, Tuple{Any, Any}} && isleaftype(T)
165165
return associative_with_eltype(DT_apply, kv, T)

base/generator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ size(g::Generator) = size(g.iter)
115115
indices(g::Generator) = indices(g.iter)
116116
ndims(g::Generator) = ndims(g.iter)
117117

118-
iteratoreltype{I,T}(::Type{Generator{I,T}}) = EltypeUnknown()
118+
iteratoreltype(::Type{Generator{I,T}}) where {I,T} = EltypeUnknown()

base/int.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ iseven(n::Integer) = !isodd(n)
7070
signbit(x::Integer) = x < 0
7171
signbit(x::Unsigned) = false
7272

73-
flipsign{T<:BitSigned}(x::T, y::T) = flipsign_int(x, y)
73+
flipsign(x::T, y::T) where {T<:BitSigned} = flipsign_int(x, y)
7474

7575
flipsign(x::Signed, y::Signed) = convert(typeof(x), flipsign(promote_noncircular(x, y)...))
7676
flipsign(x::Signed, y::Float16) = flipsign(x, bitcast(Int16, y))
@@ -166,48 +166,48 @@ julia> mod(-eps(), 3)
166166
3.0
167167
```
168168
"""
169-
function mod{T<:Integer}(x::T, y::T)
169+
function mod(x::T, y::T) where T<:Integer
170170
y == -1 && return T(0) # avoid potential overflow in fld
171171
return x - fld(x, y) * y
172172
end
173173
mod(x::Signed, y::Unsigned) = rem(y + unsigned(rem(x, y)), y)
174174
mod(x::Unsigned, y::Signed) = rem(y + signed(rem(x, y)), y)
175-
mod{T<:Unsigned}(x::T, y::T) = rem(x, y)
175+
mod(x::T, y::T) where {T<:Unsigned} = rem(x, y)
176176

177177
cld(x::Signed, y::Unsigned) = div(x, y) + (!signbit(x) & (rem(x, y) != 0))
178178
cld(x::Unsigned, y::Signed) = div(x, y) + (!signbit(y) & (rem(x, y) != 0))
179179

180180
# Don't promote integers for div/rem/mod since there is no danger of overflow,
181181
# while there is a substantial performance penalty to 64-bit promotion.
182-
div{T<:BitSigned64}(x::T, y::T) = checked_sdiv_int(x, y)
183-
rem{T<:BitSigned64}(x::T, y::T) = checked_srem_int(x, y)
184-
div{T<:BitUnsigned64}(x::T, y::T) = checked_udiv_int(x, y)
185-
rem{T<:BitUnsigned64}(x::T, y::T) = checked_urem_int(x, y)
182+
div(x::T, y::T) where {T<:BitSigned64} = checked_sdiv_int(x, y)
183+
rem(x::T, y::T) where {T<:BitSigned64} = checked_srem_int(x, y)
184+
div(x::T, y::T) where {T<:BitUnsigned64} = checked_udiv_int(x, y)
185+
rem(x::T, y::T) where {T<:BitUnsigned64} = checked_urem_int(x, y)
186186

187187

188188
# fld(x,y) == div(x,y) - ((x>=0) != (y>=0) && rem(x,y) != 0 ? 1 : 0)
189-
fld{T<:Unsigned}(x::T, y::T) = div(x,y)
190-
function fld{T<:Integer}(x::T, y::T)
189+
fld(x::T, y::T) where {T<:Unsigned} = div(x,y)
190+
function fld(x::T, y::T) where T<:Integer
191191
d = div(x, y)
192192
return d - (signbit(x y) & (d * y != x))
193193
end
194194

195195
# cld(x,y) = div(x,y) + ((x>0) == (y>0) && rem(x,y) != 0 ? 1 : 0)
196-
function cld{T<:Unsigned}(x::T, y::T)
196+
function cld(x::T, y::T) where T<:Unsigned
197197
d = div(x, y)
198198
return d + (d * y != x)
199199
end
200-
function cld{T<:Integer}(x::T, y::T)
200+
function cld(x::T, y::T) where T<:Integer
201201
d = div(x, y)
202202
return d + (((x > 0) == (y > 0)) & (d * y != x))
203203
end
204204

205205
## integer bitwise operations ##
206206

207207
(~)(x::BitInteger) = not_int(x)
208-
(&){T<:BitInteger}(x::T, y::T) = and_int(x, y)
209-
(|){T<:BitInteger}(x::T, y::T) = or_int(x, y)
210-
xor{T<:BitInteger}(x::T, y::T) = xor_int(x, y)
208+
(&)(x::T, y::T) where {T<:BitInteger} = and_int(x, y)
209+
(|)(x::T, y::T) where {T<:BitInteger} = or_int(x, y)
210+
xor(x::T, y::T) where {T<:BitInteger} = xor_int(x, y)
211211

212212
bswap(x::Union{Int8, UInt8}) = x
213213
bswap(x::Union{Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128}) =

base/iterators.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ and_iteratorsize(::HasLength, ::HasShape) = HasLength()
2323
and_iteratorsize(::HasShape, ::HasLength) = HasLength()
2424
and_iteratorsize(a, b) = SizeUnknown()
2525

26-
and_iteratoreltype{T}(iel::T, ::T) = iel
26+
and_iteratoreltype(iel::T, ::T) where {T} = iel
2727
and_iteratoreltype(a, b) = EltypeUnknown()
2828

2929
# enumerate
@@ -68,7 +68,7 @@ end
6868
eltype(::Type{Enumerate{I}}) where {I} = Tuple{Int, eltype(I)}
6969

7070
iteratorsize{I}(::Type{Enumerate{I}}) = iteratorsize(I)
71-
iteratoreltype{I}(::Type{Enumerate{I}}) = iteratoreltype(I)
71+
iteratoreltype(::Type{Enumerate{I}}) where {I} = iteratoreltype(I)
7272

7373
struct IndexValue{I,A<:AbstractArray}
7474
data::A
@@ -138,7 +138,7 @@ end
138138
eltype(::Type{IndexValue{I,A}}) where {I,A} = Tuple{eltype(I), eltype(A)}
139139

140140
iteratorsize{I}(::Type{IndexValue{I}}) = iteratorsize(I)
141-
iteratoreltype{I}(::Type{IndexValue{I}}) = iteratoreltype(I)
141+
iteratoreltype(::Type{IndexValue{I}}) where {I} = iteratoreltype(I)
142142

143143
# zip
144144

@@ -167,7 +167,7 @@ end
167167
@inline done(z::Zip1, st) = done(z.a,st)
168168

169169
iteratorsize{I}(::Type{Zip1{I}}) = iteratorsize(I)
170-
iteratoreltype{I}(::Type{Zip1{I}}) = iteratoreltype(I)
170+
iteratoreltype(::Type{Zip1{I}}) where {I} = iteratoreltype(I)
171171

172172
struct Zip2{I1, I2} <: AbstractZipIterator
173173
a::I1
@@ -187,7 +187,7 @@ end
187187
@inline done(z::Zip2, st) = done(z.a,st[1]) | done(z.b,st[2])
188188

189189
iteratorsize{I1,I2}(::Type{Zip2{I1,I2}}) = zip_iteratorsize(iteratorsize(I1),iteratorsize(I2))
190-
iteratoreltype{I1,I2}(::Type{Zip2{I1,I2}}) = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
190+
iteratoreltype(::Type{Zip2{I1,I2}}) where {I1,I2} = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
191191

192192
struct Zip{I, Z<:AbstractZipIterator} <: AbstractZipIterator
193193
a::I
@@ -238,7 +238,7 @@ end
238238
@inline done(z::Zip, st) = done(z.a,st[1]) | done(z.z,st[2])
239239

240240
iteratorsize{I1,I2}(::Type{Zip{I1,I2}}) = zip_iteratorsize(iteratorsize(I1),iteratorsize(I2))
241-
iteratoreltype{I1,I2}(::Type{Zip{I1,I2}}) = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
241+
iteratoreltype(::Type{Zip{I1,I2}}) where {I1,I2} = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
242242

243243
# filter
244244

@@ -278,7 +278,7 @@ end
278278
done(f::Filter, s) = s[1]
279279

280280
eltype(::Type{Filter{F,I}}) where {F,I} = eltype(I)
281-
iteratoreltype{F,I}(::Type{Filter{F,I}}) = iteratoreltype(I)
281+
iteratoreltype(::Type{Filter{F,I}}) where {F,I} = iteratoreltype(I)
282282
iteratorsize(::Type{<:Filter}) = SizeUnknown()
283283

284284
# Rest -- iterate starting at the given state
@@ -300,7 +300,7 @@ next(i::Rest, st) = next(i.itr, st)
300300
done(i::Rest, st) = done(i.itr, st)
301301

302302
eltype(::Type{Rest{I}}) where {I} = eltype(I)
303-
iteratoreltype{I,S}(::Type{Rest{I,S}}) = iteratoreltype(I)
303+
iteratoreltype(::Type{Rest{I,S}}) where {I,S} = iteratoreltype(I)
304304
rest_iteratorsize(a) = SizeUnknown()
305305
rest_iteratorsize(::IsInfinite) = IsInfinite()
306306
iteratorsize{I,S}(::Type{Rest{I,S}}) = rest_iteratorsize(iteratorsize(I))
@@ -366,7 +366,7 @@ take(xs, n::Integer) = Take(xs, Int(n))
366366
take(xs::Take, n::Integer) = Take(xs.xs, min(Int(n), xs.n))
367367

368368
eltype(::Type{Take{I}}) where {I} = eltype(I)
369-
iteratoreltype{I}(::Type{Take{I}}) = iteratoreltype(I)
369+
iteratoreltype(::Type{Take{I}}) where {I} = iteratoreltype(I)
370370
take_iteratorsize(a) = HasLength()
371371
take_iteratorsize(::SizeUnknown) = SizeUnknown()
372372
iteratorsize{I}(::Type{Take{I}}) = take_iteratorsize(iteratorsize(I))
@@ -421,7 +421,7 @@ drop(xs::Take, n::Integer) = Take(drop(xs.xs, Int(n)), max(0, xs.n - Int(n)))
421421
drop(xs::Drop, n::Integer) = Drop(xs.xs, Int(n) + xs.n)
422422

423423
eltype(::Type{Drop{I}}) where {I} = eltype(I)
424-
iteratoreltype{I}(::Type{Drop{I}}) = iteratoreltype(I)
424+
iteratoreltype(::Type{Drop{I}}) where {I} = iteratoreltype(I)
425425
drop_iteratorsize(::SizeUnknown) = SizeUnknown()
426426
drop_iteratorsize(::Union{HasShape, HasLength}) = HasLength()
427427
drop_iteratorsize(::IsInfinite) = IsInfinite()
@@ -457,7 +457,7 @@ An iterator that cycles through `iter` forever.
457457
cycle(xs) = Cycle(xs)
458458

459459
eltype(::Type{Cycle{I}}) where {I} = eltype(I)
460-
iteratoreltype{I}(::Type{Cycle{I}}) = iteratoreltype(I)
460+
iteratoreltype(::Type{Cycle{I}}) where {I} = iteratoreltype(I)
461461
iteratorsize{I}(::Type{Cycle{I}}) = IsInfinite()
462462

463463
function start(it::Cycle)
@@ -563,7 +563,7 @@ indices(p::Prod1) = _prod_indices(p.a, iteratorsize(p.a))
563563
end
564564
@inline done(p::Prod1, st) = done(p.a, st)
565565

566-
iteratoreltype{I}(::Type{Prod1{I}}) = iteratoreltype(I)
566+
iteratoreltype(::Type{Prod1{I}}) where {I} = iteratoreltype(I)
567567
iteratorsize{I}(::Type{Prod1{I}}) = iteratorsize(I)
568568

569569
# two iterators
@@ -590,7 +590,7 @@ product(a, b) = Prod2(a, b)
590590

591591
eltype(::Type{Prod2{I1,I2}}) where {I1,I2} = Tuple{eltype(I1), eltype(I2)}
592592

593-
iteratoreltype{I1,I2}(::Type{Prod2{I1,I2}}) = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
593+
iteratoreltype(::Type{Prod2{I1,I2}}) where {I1,I2} = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
594594
iteratorsize{I1,I2}(::Type{Prod2{I1,I2}}) = prod_iteratorsize(iteratorsize(I1),iteratorsize(I2))
595595

596596
function start(p::AbstractProdIterator)
@@ -627,7 +627,7 @@ product(a, b, c...) = Prod(a, product(b, c...))
627627

628628
eltype(::Type{Prod{I1,I2}}) where {I1,I2} = tuple_type_cons(eltype(I1), eltype(I2))
629629

630-
iteratoreltype{I1,I2}(::Type{Prod{I1,I2}}) = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
630+
iteratoreltype(::Type{Prod{I1,I2}}) where {I1,I2} = and_iteratoreltype(iteratoreltype(I1),iteratoreltype(I2))
631631
iteratorsize{I1,I2}(::Type{Prod{I1,I2}}) = prod_iteratorsize(iteratorsize(I1),iteratorsize(I2))
632632

633633
@inline function next{I1,I2}(p::Prod{I1,I2}, st)
@@ -669,7 +669,7 @@ flatten(itr) = Flatten(itr)
669669

670670
eltype(::Type{Flatten{I}}) where {I} = eltype(eltype(I))
671671
iteratorsize{I}(::Type{Flatten{I}}) = SizeUnknown()
672-
iteratoreltype{I}(::Type{Flatten{I}}) = _flatteneltype(I, iteratoreltype(I))
672+
iteratoreltype(::Type{Flatten{I}}) where {I} = _flatteneltype(I, iteratoreltype(I))
673673
_flatteneltype(I, ::HasEltype) = iteratoreltype(eltype(I))
674674
_flatteneltype(I, et) = EltypeUnknown()
675675

base/linalg/factorization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
abstract type Factorization{T} end
66

7-
eltype{T}(::Type{Factorization{T}}) = T
7+
eltype(::Type{Factorization{T}}) where {T} = T
88
transpose(F::Factorization) = error("transpose not implemented for $(typeof(F))")
99
ctranspose(F::Factorization) = error("ctranspose not implemented for $(typeof(F))")
1010

base/multidimensional.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,27 @@ module IteratorsMD
6565
one(::Type{CartesianIndex{N}}) where {N} = CartesianIndex(ntuple(x -> 1, Val{N}))
6666

6767
# arithmetic, min/max
68-
@inline (-){N}(index::CartesianIndex{N}) =
68+
@inline (-)(index::CartesianIndex{N}) where {N} =
6969
CartesianIndex{N}(map(-, index.I))
70-
@inline (+){N}(index1::CartesianIndex{N}, index2::CartesianIndex{N}) =
70+
@inline (+)(index1::CartesianIndex{N}, index2::CartesianIndex{N}) where {N} =
7171
CartesianIndex{N}(map(+, index1.I, index2.I))
72-
@inline (-){N}(index1::CartesianIndex{N}, index2::CartesianIndex{N}) =
72+
@inline (-)(index1::CartesianIndex{N}, index2::CartesianIndex{N}) where {N} =
7373
CartesianIndex{N}(map(-, index1.I, index2.I))
74-
@inline min{N}(index1::CartesianIndex{N}, index2::CartesianIndex{N}) =
74+
@inline min(index1::CartesianIndex{N}, index2::CartesianIndex{N}) where {N} =
7575
CartesianIndex{N}(map(min, index1.I, index2.I))
76-
@inline max{N}(index1::CartesianIndex{N}, index2::CartesianIndex{N}) =
76+
@inline max(index1::CartesianIndex{N}, index2::CartesianIndex{N}) where {N} =
7777
CartesianIndex{N}(map(max, index1.I, index2.I))
7878

7979
@inline (+)(i::Integer, index::CartesianIndex) = index+i
80-
@inline (+){N}(index::CartesianIndex{N}, i::Integer) = CartesianIndex{N}(map(x->x+i, index.I))
81-
@inline (-){N}(index::CartesianIndex{N}, i::Integer) = CartesianIndex{N}(map(x->x-i, index.I))
82-
@inline (-){N}(i::Integer, index::CartesianIndex{N}) = CartesianIndex{N}(map(x->i-x, index.I))
83-
@inline (*){N}(a::Integer, index::CartesianIndex{N}) = CartesianIndex{N}(map(x->a*x, index.I))
84-
@inline (*)(index::CartesianIndex,a::Integer)=*(a,index)
80+
@inline (+)(index::CartesianIndex{N}, i::Integer) where {N} = CartesianIndex{N}(map(x->x+i, index.I))
81+
@inline (-)(index::CartesianIndex{N}, i::Integer) where {N} = CartesianIndex{N}(map(x->x-i, index.I))
82+
@inline (-)(i::Integer, index::CartesianIndex{N}) where {N} = CartesianIndex{N}(map(x->i-x, index.I))
83+
@inline (*)(a::Integer, index::CartesianIndex{N}) where {N} = CartesianIndex{N}(map(x->a*x, index.I))
84+
@inline (*)(index::CartesianIndex, a::Integer) = *(a,index)
8585

8686
# comparison
87-
@inline isless{N}(I1::CartesianIndex{N}, I2::CartesianIndex{N}) = _isless(0, I1.I, I2.I)
88-
@inline function _isless{N}(ret, I1::NTuple{N,Int}, I2::NTuple{N,Int})
87+
@inline isless(I1::CartesianIndex{N}, I2::CartesianIndex{N}) where {N} = _isless(0, I1.I, I2.I)
88+
@inline function _isless(ret, I1::NTuple{N,Int}, I2::NTuple{N,Int}) where N
8989
newret = ifelse(ret==0, icmp(I1[N], I2[N]), ret)
9090
_isless(newret, Base.front(I1), Base.front(I2))
9191
end
@@ -155,7 +155,7 @@ module IteratorsMD
155155
end
156156
iter.start
157157
end
158-
@inline function next{I<:CartesianIndex}(iter::CartesianRange{I}, state)
158+
@inline function next(iter::CartesianRange{I}, state) where I<:CartesianIndex
159159
state, I(inc(state.I, iter.start.I, iter.stop.I))
160160
end
161161
# increment & carry
@@ -1195,7 +1195,7 @@ end
11951195

11961196
## findn
11971197

1198-
@generated function findn{N}(B::BitArray{N})
1198+
@generated function findn(B::BitArray{N}) where N
11991199
quote
12001200
nnzB = countnz(B)
12011201
I = ntuple(x->Vector{Int}(nnzB), Val{$N})
@@ -1255,7 +1255,7 @@ function checkdims_perm{TP,TB,N}(P::AbstractArray{TP,N}, B::AbstractArray{TB,N},
12551255
end
12561256

12571257
for (V, PT, BT) in [((:N,), BitArray, BitArray), ((:T,:N), Array, StridedArray)]
1258-
@eval @generated function permutedims!{$(V...)}(P::$PT{$(V...)}, B::$BT{$(V...)}, perm)
1258+
@eval @generated function permutedims!(P::$PT{$(V...)}, B::$BT{$(V...)}, perm) where $(V...)
12591259
quote
12601260
checkdims_perm(P, B, perm)
12611261

base/pair.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const => = Pair
1010
start(p::Pair) = 1
1111
done(p::Pair, i) = i>2
1212
next(p::Pair, i) = (getfield(p,i), i+1)
13-
eltype{A,B}(p::Pair{A,B}) = Union{A,B}
13+
eltype(p::Pair{A,B}) where {A,B} = Union{A,B}
1414

1515
indexed_next(p::Pair, i::Int, state) = (getfield(p,i), i+1)
1616

0 commit comments

Comments
 (0)