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

Ensure that all isequal methods return Bool to fix inference #26184

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

nalimilan
Copy link
Member

Without this, the return type of isequal would be inferred as Union{Bool,Missing} when the type of the argument is inferred as Any.

Without this, the return type of isequal() would be inferred as Union{Bool,Missing}
when the type of the argument is inferred as Any.
@nalimilan nalimilan added compiler:inference Type inference missing data Base.missing and related functionality labels Feb 23, 2018
@@ -69,6 +69,8 @@ end
@test !isless(missing, missing)
@test !isless(missing, 1)
@test isless(1, missing)

@test !any(T -> T === Union{Missing,Bool}, Base.return_types(isequal, Tuple{Any,Any}))
Copy link
Member

Choose a reason for hiding this comment

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

all(T->T===Bool, ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That doesn't work since there are several Any values in that list (not sure why).

@nalimilan nalimilan closed this Mar 14, 2018
@nalimilan nalimilan reopened this Mar 14, 2018
@nalimilan
Copy link
Member Author

Bump.

@nalimilan nalimilan merged commit f355935 into master Mar 15, 2018
@nalimilan nalimilan deleted the nl/isequal branch March 15, 2018 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference missing data Base.missing and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants