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

Strange dispatch bug with ::Type, depends on order of function evaluations #5577

Closed
toivoh opened this issue Jan 27, 2014 · 0 comments
Closed
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@toivoh
Copy link
Contributor

toivoh commented Jan 27, 2014

Running

f(::Any)=false
f(::Type)=true
@show  f((Int,String,2))
@show  f(((Int,String),String))
@show  f((Int,))
@show  f((Int,String))
@show  f(Int)

in a fresh julia session gives

f((Int,String,2)) => false
f(((Int,String),String)) => false
f((Int,)) => false
f((Int,String)) => false
f(Int) => true

But if we remove @show f((Int,String,2)) then it works as expected:

f(::Any)=false
f(::Type)=true
@show  f(((Int,String),String))
@show  f((Int,))
@show  f((Int,String))
@show  f(Int)

gives

f(((Int,String),String)) => true
f((Int,)) => true
f((Int,String)) => true
f(Int) => true

It seems like the negative result for @show f((Int,String,2)) somehow contaminates the further invocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants