Skip to content

Commit

Permalink
Resolve signature issue (#40)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
willtebbutt and github-actions[bot] authored Jul 27, 2023
1 parent 124baaa commit 23d4aa6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
version:
- "1.0" # LTS
- "1.6" # LTS
- "1" # Latest Release
os:
- ubuntu-latest
Expand All @@ -30,11 +30,6 @@ jobs:
arch: x86
- os: windows-latest
arch: x86
include:
# Add a 1.5 job because that's what Invenia actually uses
- os: ubuntu-latest
version: 1.5
arch: x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExprTools"
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
authors = ["Invenia Technical Computing"]
version = "0.1.9"
version = "0.1.10"

[compat]
julia = "1"
Expand Down
3 changes: 2 additions & 1 deletion src/type_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ e.g. `parameters(Foo{A, B, C}) == [A, B, C]`
"""
parameters(sig::UnionAll) = parameters(sig.body)
parameters(sig::DataType) = sig.parameters
parameters(sig::Union) = Base.uniontypes(sig)
parameters(sig::Union) = Base.uniontypes(sig)
parameters(sig::TypeVar) = [sig]
16 changes: 14 additions & 2 deletions test/type_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,17 @@

# Non-parametric type
@test isempty(parameters(Bool))
end
end

# type-vars in signatures
s = only(parameters(TypeVar(:T)))
@test s.name == :T
@test s.lb == Union{}
@test s.ub == Any

# https://github.com/invenia/ExprTools.jl/issues/39
@testset "#39" begin
s = signature(Tuple{Type{T},T} where {T<:Number})
@test only(s[:whereparams]).args[1] == :T
end
end
end

4 comments on commit 23d4aa6

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Register Failed
@willtebbutt, it looks like you are not a publicly listed member/owner in the parent organization (invenia).
If you are a member/owner, you will need to change your membership to public. See GitHub Help

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88479

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.10 -m "<description of version>" 23d4aa68e5cb015957fdfb523143fefad4cfef0c
git push origin v0.1.10

Please sign in to comment.