From 4350398da344a91458ce4e60b8821ca1fb0627ed Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 17 Jan 2018 20:48:37 +0100 Subject: [PATCH 1/2] fix findfirst returning nothing on 0.7 (cherry picked from commit 608aa4e2e9bdfb47d5cb0bbd4d85e555e7f74edc) --- src/utilities.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities.jl b/src/utilities.jl index d7f934c..c38667c 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -249,7 +249,7 @@ function keywords(func, m::Method) filter!(arg -> !contains(string(arg), "#"), kwargs) # Keywords *may* not be sorted correctly. We move the vararg one to the end. local index = findfirst(arg -> endswith(string(arg), "..."), kwargs) - if index > 0 + if index != nothing && index > 0 # TODO: use Compat.findfirst later on kwargs[index], kwargs[end] = kwargs[end], kwargs[index] end return kwargs From d905a493c578fc2323aa1211437fc147b0031395 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 17 Jan 2018 21:34:41 +0100 Subject: [PATCH 2/2] some more fixes (cherry picked from commit 1f42a01cda1c0e00915c3d445346d2619ec8c6b8) --- REQUIRE | 2 +- src/utilities.jl | 2 +- test/runtests.jl | 2 +- test/tests.jl | 8 ++++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/REQUIRE b/REQUIRE index 2845359..d2f6cd5 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ julia 0.6 -Compat 0.30 # @nospecialize +Compat 0.33 # Compat.Test diff --git a/src/utilities.jl b/src/utilities.jl index c38667c..3c86219 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -105,7 +105,7 @@ $(:SIGNATURES) Is the type `t` a `bitstype`? """ -isbitstype(@nospecialize(t)) = isleaftype(t) && sizeof(t) > 0 && isbits(t) +isbitstype(@nospecialize(t)) = isconcrete(t) && sizeof(t) > 0 && isbits(t) """ $(:SIGNATURES) diff --git a/test/runtests.jl b/test/runtests.jl index 883d055..56e1c5d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using DocStringExtensions -using Base.Test +using Compat.Test include("tests.jl") diff --git a/test/tests.jl b/test/tests.jl index 617f4e4..c37b535 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -93,7 +93,7 @@ end end @testset "format" begin # Setup. - doc = Docs.DocStr(Core.svec(), Nullable(), Dict()) + doc = Docs.DocStr(Core.svec(), nothing, Dict()) buf = IOBuffer() # Errors. @@ -378,7 +378,11 @@ end @test DSE.alltypesigs(Union{}) == Any[] @test DSE.alltypesigs(Union{Tuple{}}) == Any[Tuple{}] @test DSE.alltypesigs(Tuple{}) == Any[Tuple{}] - @test DSE.alltypesigs(Type{T} where {T}) == Any[Type{T} where T] + + # TODO: Clean me up + T = Type{T} where {T} + @test DSE.alltypesigs(T) == + Base.rewrap_unionall.(DSE.uniontypes(Base.unwrap_unionall(T)), T) end @testset "groupby" begin let groups = DSE.groupby(Int, Vector{Int}, collect(1:10)) do each