File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ where X and Y are the types involved in the trait.
27
27
(SUPER is not used here but in Traits.jl, thus retained for possible
28
28
future compatibility.)
29
29
"""
30
- abstract Trait{SUPER}
30
+ abstract Trait # {SUPER}
31
31
32
32
"""
33
33
The set of all types not belonging to a trait is encoded by wrapping
Original file line number Diff line number Diff line change 1
1
using SimpleTraits
2
2
using Base. Test
3
3
4
- trait = SimpleTraits. trait
4
+ const trait = SimpleTraits. trait
5
5
6
6
# @test_throws MethodError trait(4)
7
7
@test_throws ErrorException istrait (4 )
@@ -80,18 +80,24 @@ type C9<:A9 end
80
80
81
81
# This will overwrite the definition def1 above
82
82
83
- VERSION >= v " 0.5" && println (" \n One 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 (" \n One 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
86
90
@test f (5 )== 10
87
91
@test f (5. )== 10
88
92
@traitimpl Tr2{Integer, Integer}
89
93
@test f (5. )== 10
90
- @test ! (f (5 )== 100 )
91
- # needed to update method cache:
92
- VERSION >= v " 0.5" && println (" \n Two 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 (" \n Two warnings expected:" )
98
+ @traitfn f {X; Tr2{X,X}} (x:: X ) = 100
99
+ println (" " )
100
+ end
95
101
@test f (5 )== 100
96
102
@test f (5. )== 10
97
103
You can’t perform that action at this time.
0 commit comments