Skip to content

Commit

Permalink
Compat.names supporting kwargs for all and imported
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Feb 18, 2018
1 parent a5df998 commit f526085
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ Currently, the `@compat` macro supports the following syntaxes:

* `firstindex` to obtain the first index of an iterable ([#25458]).

* `Compat.names` supporting keyword arguments for `all` and `imported` ([#25647]).


## Renaming

Expand Down Expand Up @@ -511,6 +513,7 @@ includes this fix. Find the minimum version from there.
[#23812]: https://github.com/JuliaLang/julia/issues/23812
[#23931]: https://github.com/JuliaLang/julia/issues/23931
[#24047]: https://github.com/JuliaLang/julia/issues/24047
[#24182]: https://github.com/JuliaLang/julia/issues/24182
[#24282]: https://github.com/JuliaLang/julia/issues/24282
[#24361]: https://github.com/JuliaLang/julia/issues/24361
[#24372]: https://github.com/JuliaLang/julia/issues/24372
Expand All @@ -526,6 +529,7 @@ includes this fix. Find the minimum version from there.
[#24714]: https://github.com/JuliaLang/julia/issues/24714
[#24785]: https://github.com/JuliaLang/julia/issues/24785
[#24808]: https://github.com/JuliaLang/julia/issues/24808
[#24831]: https://github.com/JuliaLang/julia/issues/24831
[#24874]: https://github.com/JuliaLang/julia/issues/24874
[#25012]: https://github.com/JuliaLang/julia/issues/25012
[#25021]: https://github.com/JuliaLang/julia/issues/25021
Expand Down Expand Up @@ -555,9 +559,10 @@ includes this fix. Find the minimum version from there.
[#25629]: https://github.com/JuliaLang/julia/issues/25629
[#25634]: https://github.com/JuliaLang/julia/issues/25634
[#25646]: https://github.com/JuliaLang/julia/issues/25646
[#25647]: https://github.com/JuliaLang/julia/issues/25647
[#25654]: https://github.com/JuliaLang/julia/issues/25654
[#25705]: https://github.com/JuliaLang/julia/issues/25705
[#25706]: https://github.com/JuliaLang/julia/issues/25706
[#25738]: https://github.com/JuliaLang/julia/issues/25738
[#25780]: https://github.com/JuliaLang/julia/issues/25780
[#24182]: https://github.com/JuliaLang/julia/issues/24182
[#24673]: https://github.com/JuliaLang/julia/issues/24673
[#25819]: https://github.com/JuliaLang/julia/issues/25819
7 changes: 7 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,13 @@ else
findall(b::OccursIn, a::Number) = a in b.x ? [1] : Vector{Int}()
end

# https://github.com/JuliaLang/julia/pull/25647
@static if VERSION < v"0.7.0-DEV.3526"
names(m; all=true, imported=true) = Base.names(m, all, imported)
else
import Base: names
end

if VERSION >= v"0.7.0-DEV.3666"
import UUIDs
else
Expand Down
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1413,4 +1413,12 @@ end
import Compat.Markdown
@test isa(Markdown.parse("foo"), Markdown.MD)

# 0.7.0-DEV.3526
module TestNames
export foo
function bar end
end
@test :foo in Compat.names(TestNames)
@test :bar in Compat.names(TestNames, all=true)

nothing

0 comments on commit f526085

Please sign in to comment.