Skip to content

Conversation

simeonschaub
Copy link
Member

@simeonschaub simeonschaub commented Jul 6, 2021

Fixes #41489.

@simeonschaub simeonschaub added backport 1.7 compiler:inference Type inference rationals The Rational type and values thereof labels Jul 6, 2021
base/rational.jl Outdated

function +(x::Rational, y::Rational)
function +(x::Rational, y::Rational)::Rational
xp, yp = promote(x, y)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
xp, yp = promote(x, y)
xp, yp = promote(x, y)::NTuple{2,Rational}

How about adding annotations here instead ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems reasonable.

@aviatesk aviatesk merged commit cf4e1c4 into master Jul 7, 2021
@aviatesk aviatesk deleted the sds/plus_rational branch July 7, 2021 15:40
KristofferC pushed a commit that referenced this pull request Jul 19, 2021
* fix #41489: inference of `+(::Rational, Rational)`

* implement review comments

(cherry picked from commit cf4e1c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference rationals The Rational type and values thereof
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.7-beta2: type instability for matrix multiplication
3 participants