-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
problem with typemin and typemax for Irrational #36978
Comments
@nalimilan - a little corner-case surprise I do not know the internals of Now I also see that we have also a problem here:
|
Also while we are at it:
do we think it is consistent? |
Bumping this I tested today on Julia 1.6.2 and got a similar error. julia> t = typeof(pi)
Irrational{:π}
julia> hasmethod(typemin, (t,))
true
julia> typemin(t)
ERROR: MethodError: no method matching typemin(::Type{Irrational{:π}})
Closest candidates are:
typemin(::Union{Dates.DateTime, Type{Dates.DateTime}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Dates/src/types.jl:427
typemin(::Union{Dates.Date, Type{Dates.Date}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Dates/src/types.jl:429
typemin(::Union{Dates.Time, Type{Dates.Time}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Dates/src/types.jl:431
...
Stacktrace:
[1] top-level scope
@ REPL[3]:1
julia> ```
` |
There is |
Still reproduces on 1.8.3 |
I don't think this is connected to For example: julia> h(::T) where {T} = hasmethod(typemin, Tuple{T})
h (generic function with 1 method)
julia> h(::Type{T}) where {T} = hasmethod(typemin, Tuple{Type{T}})
h (generic function with 2 methods)
julia> h(pi)
true
julia> h(typeof(pi))
false
Furthermore, I don't think it's even theoretically possible to have a recursive So this issue should probably be closed, perhaps in favor of a "recursive Note that julia> a(x) = applicable(typemin, x)
a (generic function with 1 method)
julia> a(pi)
true
julia> a(typeof(pi))
false EDIT: for reference: |
Good point. Then probably there should be a special definition for |
You mean we should define |
I think the PR is OK, but some will be confused by |
Well
I am not sure what is best. But I meant what @nalimilan has written. Also note that Note that
|
I think it is a bug:
The same happens with
typemax
The text was updated successfully, but these errors were encountered: