Skip to content

Commit 23d4aa6

Browse files
Resolve signature issue (#40)
* Typevar fix * Formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update CI * Fix tests: * Bump patch * Fix formatting * Fix formatting --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 124baaa commit 23d4aa6

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
version:
18-
- "1.0" # LTS
18+
- "1.6" # LTS
1919
- "1" # Latest Release
2020
os:
2121
- ubuntu-latest
@@ -30,11 +30,6 @@ jobs:
3030
arch: x86
3131
- os: windows-latest
3232
arch: x86
33-
include:
34-
# Add a 1.5 job because that's what Invenia actually uses
35-
- os: ubuntu-latest
36-
version: 1.5
37-
arch: x64
3833
steps:
3934
- uses: actions/checkout@v2
4035
- uses: julia-actions/setup-julia@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExprTools"
22
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
33
authors = ["Invenia Technical Computing"]
4-
version = "0.1.9"
4+
version = "0.1.10"
55

66
[compat]
77
julia = "1"

src/type_utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ e.g. `parameters(Foo{A, B, C}) == [A, B, C]`
77
"""
88
parameters(sig::UnionAll) = parameters(sig.body)
99
parameters(sig::DataType) = sig.parameters
10-
parameters(sig::Union) = Base.uniontypes(sig)
10+
parameters(sig::Union) = Base.uniontypes(sig)
11+
parameters(sig::TypeVar) = [sig]

test/type_utils.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,17 @@
5656

5757
# Non-parametric type
5858
@test isempty(parameters(Bool))
59-
end
60-
end
59+
60+
# type-vars in signatures
61+
s = only(parameters(TypeVar(:T)))
62+
@test s.name == :T
63+
@test s.lb == Union{}
64+
@test s.ub == Any
65+
66+
# https://github.com/invenia/ExprTools.jl/issues/39
67+
@testset "#39" begin
68+
s = signature(Tuple{Type{T},T} where {T<:Number})
69+
@test only(s[:whereparams]).args[1] == :T
70+
end
71+
end
72+
end

0 commit comments

Comments
 (0)