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

Prevent inference issue of BigInt(::UInt128) due to recursion #30050

Closed
wants to merge 1 commit into from

Conversation

martinholters
Copy link
Member

Not pretty, but should do the job. Let's see what CI says...

Replaces #30032, fixes #29923.

@martinholters
Copy link
Member Author

Hm, no, this seems to be only part of the story, because this type assertion is still needed:

julia/base/int.jl

Lines 770 to 772 in e209c3d

function div(x::UInt128, y::UInt128)
return UInt128(div(BigInt(x), BigInt(y)))::UInt128
end

And according to my reasoning, it should now be safe to remove it.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Nov 20, 2018

It's the presence of the kwarg, not the recursion, that makes it so we can't infer this.

@vtjnash vtjnash closed this Nov 20, 2018
@vtjnash
Copy link
Sponsor Member

vtjnash commented Nov 20, 2018

(it turns out that it's not the only recursion point also, since parse.jl:111 was recently changed to attempt to do compile-time constant propagation at m::T = base == 10 ? div(typemax(T) - T(9), T(10)) : ..., in #29892)

@martinholters martinholters deleted the mh/fix_29923 branch November 21, 2018 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consistent 32bit CI error
2 participants