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

fix #17354, expand Tuple{Vararg{Any,2}} on construction #17361

Merged
merged 1 commit into from
Jul 12, 2016

Conversation

JeffBezanson
Copy link
Member

No description provided.

@JeffBezanson
Copy link
Member Author

@timholy Is this ok? f(x::Vararg{Any,3}) now gets expanded to f(x, ?, ?) but everything seems to work otherwise. Maybe I should just adjust the method showing code.

@timholy
Copy link
Member

timholy commented Jul 10, 2016

Thanks for tackling this! It seems fine to me; given that instantiation evidently works with non-leaftypes, it doesn't seem to make much sense to limit it to leaftypes. I'd be fine with it if this ends up requiring adjustment in the show code, or even in the result of that test (as long as the signature was "findable" from the output).

I hadn't gotten around to debugging this issue myself yet, but one thing that puzzled me is why Tuple{Vararg{Any,2}} wasn't being treated as identical to Tuple{Any,Any} for the purposes of dispatch. If memory serves (and it may not), at one point in the development of #11242 I had the two being treated "identically" without introducing any kind of instantiation: perhaps the only test in the entire suite I had to comment out was this one, and trying to get that to pass, esp. given my limited understanding of how ccall works, led me to introduce instantiation. (Obviously, the codegen specialization issue that @vtjnash fixed for me also required instantiation, so clearly it has major benefits.) But I guess one risk of having introduced instantiation is that it becomes harder to detect regressions or limitations in type-equivalence.

I almost wonder if we want to put instantiation under some kind of flag that we can change via a ccall, and have a section of test/core.jl that turns it off?

@vtjnash
Copy link
Member

vtjnash commented Jul 11, 2016

this also should fix #16618

@JeffBezanson
Copy link
Member Author

Fixed the showing issue, and found what seems to be an unused function to boot.

@timholy you're right we could/should probably do more to fix this from the other end, but for now I think this is a reasonable defensive fix.

@JeffBezanson JeffBezanson merged commit f47d9fe into master Jul 12, 2016
@yuyichao yuyichao deleted the jb/fix17354 branch July 12, 2016 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants