Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Commit

Permalink
Fix ambiguity warnings from Compat for JuliaLang/julia#9098
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Feb 9, 2015
1 parent 3a8cad5 commit e0f7a54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.3.0-
StatsBase 0.3
Compat 0.2.6
Compat 0.2.12-
14 changes: 14 additions & 0 deletions src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ getindex(t::AbstractDataArray, i::Real) =
## getindex: DataArray

# Scalar case
function getindex(da::DataArray, I::Real)
if getindex(da.na, I)
return NA
else
return getindex(da.data, I)
end
end
@nsplat N function getindex(da::DataArray, I::NTuple{N,Real}...)
if getindex(da.na, I...)
return NA
Expand Down Expand Up @@ -159,6 +166,13 @@ end
## getindex: PooledDataArray

# Scalar case
function getindex(pda::PooledDataArray, I::Real)
if getindex(pda.refs, I) == 0
return NA
else
return pda.pool[getindex(pda.refs, I)]
end
end
@nsplat N function getindex(pda::PooledDataArray, I::NTuple{N,Real}...)
if getindex(pda.refs, I...) == 0
return NA
Expand Down

0 comments on commit e0f7a54

Please sign in to comment.