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

return_types() confused after running many tests #21740

Closed
nalimilan opened this issue May 7, 2017 · 5 comments
Closed

return_types() confused after running many tests #21740

nalimilan opened this issue May 7, 2017 · 5 comments
Labels
compiler:inference Type inference

Comments

@nalimilan
Copy link
Member

I have a branch of CategoricalArrays here where a complex call to Base.return_types returns Array{String, 1} when called immediately after loading the package, but Union{Array{_,1} where _, NullableArrays.NullableArray{_,1} where _} when called after running lots of tests. If Base.return_types is called immediately, then it succeeds later, even after running the tests.

I couldn't find a simple reproducer for now, but if you checkout that branch you can reproduce it easily:

using CategoricalArrays
# Uncomment to trigger bug (the tests will fail)
# include("test/recode.jl")
Base.return_types(recode, Tuple{Vector{Int}, Void, Pair{Int, String}, Pair{UnitRange{Int}, String}, Pair{Vector{Int}, String}, Pair{UnitRange{Int}, String}})
@nalimilan nalimilan added the compiler:inference Type inference label May 7, 2017
@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2017

The return value of return_types can certainly change after you've defined new methods.

@nalimilan
Copy link
Member Author

nalimilan commented May 7, 2017

Yes, but the include call does not define any new methods. It just tests recode for many different cases.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 9, 2017

Was this fixed by either of #21677 or #21933?

@nalimilan
Copy link
Member Author

Indeed, tests now pass on master, so that was probably #21677 (since #21933 isn't merged yet).

@nalimilan
Copy link
Member Author

It's also fixed in 0.6.0-rc3.0, which is really cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

No branches or pull requests

3 participants