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

setprecision(::Function, ::Type, ::Int) regression #55899

Open
nsajko opened this issue Sep 27, 2024 · 0 comments
Open

setprecision(::Function, ::Type, ::Int) regression #55899

nsajko opened this issue Sep 27, 2024 · 0 comments
Labels
bignums BigInt and BigFloat regression 1.12 Regression in the 1.12 release

Comments

@nsajko
Copy link
Contributor

nsajko commented Sep 27, 2024

Passes on v1.11, throws MethodError on v1.12:

using Test

struct Issue55899 end

const issue_55899_precision = Ref{Any}(123)

@testset "`setprecision` regression, issue #55899" begin
    function Base.precision(::Type{Issue55899})
        issue_55899_precision[]
    end

    function Base.setprecision(::Type{Issue55899}, p::Int)
        issue_55899_precision[] = p
    end

    function issue_55899_get_set_precision(p::Int)
        f = () -> precision(Issue55899)
        setprecision(f, Issue55899, p)
    end

    for p  (1, 10, 100)
        @test p === issue_55899_get_set_precision(p)
        @test 123 === precision(Issue55899)
    end
end

xref #51362

xref kalmarek/Arblib.jl#187

@nsajko nsajko added bignums BigInt and BigFloat regression 1.12 Regression in the 1.12 release labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bignums BigInt and BigFloat regression 1.12 Regression in the 1.12 release
Projects
None yet
Development

No branches or pull requests

1 participant