Skip to content

Commit 81a5d17

Browse files
committed
Updated to run on current master
Remove try-end block in runtests.jl after JuliaLang/julia#20103 is fixed.
1 parent 32079f0 commit 81a5d17

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/SimpleTraits.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ where X and Y are the types involved in the trait.
2727
(SUPER is not used here but in Traits.jl, thus retained for possible
2828
future compatibility.)
2929
"""
30-
abstract Trait{SUPER}
30+
abstract Trait #{SUPER}
3131

3232
"""
3333
The set of all types not belonging to a trait is encoded by wrapping

test/runtests.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using SimpleTraits
22
using Base.Test
33

4-
trait = SimpleTraits.trait
4+
const trait = SimpleTraits.trait
55

66
# @test_throws MethodError trait(4)
77
@test_throws ErrorException istrait(4)
@@ -80,18 +80,24 @@ type C9<:A9 end
8080

8181
# This will overwrite the definition def1 above
8282

83-
VERSION>=v"0.5" && println("\nOne warning expected:")
84-
@traitfn f{X; !Tr2{X,X}}(x::X) = 10
85-
@traitfn f{X; Tr2{X,X}}(x::X) = 100
83+
VERSION>=v"0.5" && VERSION<v"0.6-dev" && println("\nOne warning expected:")
84+
try # https://github.com/JuliaLang/julia/issues/20103
85+
@traitfn f{X; !Tr2{X,X}}(x::X) = 10
86+
end
87+
try # https://github.com/JuliaLang/julia/issues/20103
88+
@traitfn f{X; Tr2{X,X}}(x::X) = 100
89+
end
8690
@test f(5)==10
8791
@test f(5.)==10
8892
@traitimpl Tr2{Integer, Integer}
8993
@test f(5.)==10
90-
@test !(f(5)==100)
91-
# needed to update method cache:
92-
VERSION>=v"0.5" && println("\nTwo warnings expected:")
93-
@traitfn f{X; Tr2{X,X}}(x::X) = 100
94-
println("")
94+
if VERSION<v"0.6-dev"
95+
@test !(f(5)==100)
96+
# needed to update method cache:
97+
VERSION>=v"0.5" && println("\nTwo warnings expected:")
98+
@traitfn f{X; Tr2{X,X}}(x::X) = 100
99+
println("")
100+
end
95101
@test f(5)==100
96102
@test f(5.)==10
97103

0 commit comments

Comments
 (0)