Skip to content

Commit

Permalink
Fixed failing test
Browse files Browse the repository at this point in the history
I'm a bit stomped by this test failure as it didn't show up in the CI of PR:
#34

Furthermore, the same issue existed as far back as
#25

I tried to see whether this was introduced in one of the minor
versions of Julia 0.5.  But running the test now locally fails for all
0.5.0, 0.5.1 and 0.5.2.

So, not sure what changed.
  • Loading branch information
mauro3 committed Aug 10, 2017
1 parent b3e5395 commit e2c5572
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SimpleTraits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@ macro traitimpl(tr)
$fnhead = $trname{$(paras...)}
VERSION < v"0.6-" && ($isfnhead = true) # Add the istrait definition as otherwise
# method-caching can be an issue.
nothing
end
else
return quote
$fnhead = Not{$trname{$(paras...)}}
VERSION < v"0.6-" && ($isfnhead = false) # Add the istrait definition as otherwise
# method-caching can be an issue.
nothing
end
end
elseif tr.head==:call
Expand All @@ -177,12 +179,14 @@ macro traitimpl(tr)
P1 = $P1
return $fn($(P2...)) ? :($Tr{$(P1...)}) : :(Not{$Tr{$(P1...)}})
end
nothing
end)
else
return esc(quote
function SimpleTraits.trait{$(P1...)}(::Type{$Tr{$(P1...)}})
return $fn($(P2...)) ? $Tr{$(P1...)} : Not{$Tr{$(P1...)}}
end
nothing
end)
end
else
Expand Down
2 changes: 1 addition & 1 deletion test/base-traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ type T9867 end
@test istrait(IsCallable{T9867})

@test istrait(IsIterator{Array})
@test !istrait(IsIterator{Cmd})

This comment has been minimized.

Copy link
@mauro3

mauro3 Aug 10, 2017

Author Owner

This tests passed on my local machine until recently and passed on CI runs until 26 May 2017:

Not sure what happened as I cannot reproduce this with any of Julia 0.5.0, 0.5.1 and 0.5.2 (see also commit message).

This comment has been minimized.

Copy link
@mauro3

mauro3 Aug 10, 2017

Author Owner

There it is:
JuliaLang/Compat.jl#379 (comment)
as it is in Compat, the version of Julia did not matter.

@test !istrait(IsIterator{Symbol})
@test istrait(IsIterator{Base.UnitRange{Int}})
@test istrait(IsIterator{Base.UnitRange})

0 comments on commit e2c5572

Please sign in to comment.