Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_unbound_args with Union fails #252

Closed
filchristou opened this issue Nov 22, 2023 · 2 comments
Closed

test_unbound_args with Union fails #252

filchristou opened this issue Nov 22, 2023 · 2 comments

Comments

@filchristou
Copy link

I think the following should not fail, right ?

module TestMod

myfun(x::Union{Int, T}) where T<:Number = T

end
julia> Aqua.test_unbound_args(TestMod)
Unbound type parameters detected:
[1] myfun(x::Union{Int64, T}) where T<:Number @ Main.TestMod ~/code/julia/aquatest/testmod.jl:3
Test Failed at /u/home/wima/fchrstou/.julia/packages/Aqua/jBmtw/src/unbound_args.jl:50
  Expression: isempty(unbounds)
   Evaluated: isempty(Method[myfun(x::Union{Int64, T}) where T<:Number @ Main.TestMod ~/code/julia/aquatest/testmod.jl
:3])

ERROR: There was an error during testing

Test.has_unbound_vars(TestMod.myfun) == false if that means anything to you.

@lgoettgens
Copy link
Collaborator

When you input an element of type Int, the type parameter T does not have a well-defined value and thus let's the test fail here.
Everything seems to be as intended.

@filchristou
Copy link
Author

Hm.. Indeed. Ah that's weird; I expected in that case to get T===Int since Union{Int, Int} === Int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants