-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ambiguity warning (Rational->BigFloat conversion)
- Loading branch information
1 parent
d265f4d
commit a85476b
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a85476b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes. That was an oversight.
a85476b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix was wrong BTW (sorry); the next commit is the one which actually works. (alternative fix: as in this commit, but also annotate the previous method as
convert{S<:Integer}(::Type{FloatingPoint}, x::Rational{S})
)The ambiguity comes from the fact that in method definitions
Rational
is equivalent toRational{S<:Integer}
(as per the type definition), whileRational{S}
is seen as more general (although it can't possibly be).a85476b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an issue about this: dispatch should automatically restrict
Rational{S}
toRational{S<:Integer}
.