Skip to content

Commit 71e8ac8

Browse files
committed
update CI and REQUIRE
1 parent ee53060 commit 71e8ac8

File tree

6 files changed

+12
-19
lines changed

6 files changed

+12
-19
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.6
76
- nightly
87
# matrix:
98
# allow_failures:

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
julia 0.6
2-
Compat 0.26.0
1+
julia 0.7
32
MacroTools 0.3.2

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
53
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
64
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
75

src/SimpleTraits.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ __precompile__()
22

33
module SimpleTraits
44
using MacroTools
5-
using Compat
65
const curmod = nameof(@__MODULE__)
76

87
import InteractiveUtils
@@ -189,7 +188,7 @@ end
189188
dispatch_cache = Dict() # to ensure that the trait-dispatch function is defined only once per pair
190189
let
191190
global traitfn
192-
function traitfn(tfn, cur_module)
191+
function traitfn(tfn, macro_module)
193192
# Need
194193
# f(x::X,Y::Y) where {X,Y} = f(trait(Tr1{X,Y}), x, y)
195194
# f(::False, x, y)= ...
@@ -338,7 +337,7 @@ let
338337
end
339338
# Create the trait dispatch function
340339
ex = fn
341-
key = (cur_module, fname, typs0, strip_kw(args0), trait0_opposite)
340+
key = (macro_module, fname, typs0, strip_kw(args0), trait0_opposite)
342341
if !(key keys(dispatch_cache)) # define trait dispatch function
343342
if !haskwargs
344343
ex = if oldfn_syntax
@@ -413,11 +412,7 @@ Defines a function dispatching on a trait. Examples:
413412
Note that the second example is just syntax sugar for `@traitfn f(x::X,y::Y) where {X,Y; Not{Tr1{X,Y}}} = ...`.
414413
"""
415414
macro traitfn(tfn)
416-
@static if isdefined(Base, Symbol("@__MODULE__"))
417-
esc(traitfn(tfn, __module__))
418-
else
419-
esc(traitfn(tfn, current_module()))
420-
end
415+
esc(traitfn(tfn, __module__))
421416
end
422417

423418
######

test/base-traits-inference.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Dict with base-traits to check using value[1] as type and value[2]
66
# as number of lines allowed in llvm code
77
cutoff = 5
8-
basetrs = [VERSION<v"0.7-" ? :IsLeafType=>:Int : :IsConcrete=>:Int,
8+
basetrs = [#VERSION<v"0.7-" ? :IsLeafType=>:Int : :IsConcrete=>:Int,
99
:IsBits=>:Int,
1010
:IsImmutable=>:Int,
1111
:IsContiguous=>:(SubArray{Int64,1,Array{Int64,1},Tuple{Array{Int64,1}},false}),
@@ -15,7 +15,10 @@ basetrs = [VERSION<v"0.7-" ? :IsLeafType=>:Int : :IsConcrete=>:Int,
1515
:IsCallable=>:(typeof(sin)),
1616
:IsIterator=>:(Dict{Int,Int})]
1717

18-
# for (bt, tp) in basetrs
19-
# @show bt
20-
# @test @eval @check_fast_traitdispatch $bt $tp true
21-
# end
18+
for (bt, tp) in basetrs
19+
if bt==:IsConcrete
20+
@test_broken @eval @check_fast_traitdispatch $bt $tp true
21+
else
22+
@test @eval @check_fast_traitdispatch $bt $tp true
23+
end
24+
end

test/base-traits.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using SimpleTraits.BaseTraits
2-
using Compat: view
32

43
@test istrait(IsAnything{Any})
54
@test istrait(IsAnything{Union{}})

0 commit comments

Comments
 (0)