Skip to content

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

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

Open
nsajko opened this issue Sep 27, 2024 · 0 comments · May be fixed by #58586
Open

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

nsajko opened this issue Sep 27, 2024 · 0 comments · May be fixed by #58586
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
@JeffBezanson JeffBezanson added triage This should be discussed on a triage call and removed triage This should be discussed on a triage call labels May 30, 2025
@JeffBezanson JeffBezanson linked a pull request May 30, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants