JuliaLang/julia — pull request #6421 by simonster (2014-04-05 03:47:12+00:00)
Title: Don't emit convert_tuple calls when no conversion is necessary

Calling `convert` with tuple arguments currently always calls `convert_tuple` and allocates a new tuple on the heap even when inference knows that no conversion is necessary. This is a bit silly, especially when the call to `convert` is implicit in a type constructor there's nothing you can do about it.

This PR avoids calling `convert_tuple` when we know we don't have to. I think I did this right, but I'm a little confused about the distinction between `(Type{T}, Type{S})` and `Type{(T,S)}`.

We might also want to inline `convert_tuple` when a conversion is necessary but we know the type of `x`.