JuliaLang/julia — pull request #9485 by dhoegh (2014-12-29 16:04:54+00:00)
Title: Extended printing at a MethodError.

I have extended #7714 with the following:
* Take into account that args... is a match and removed the requirement of equal lengths of arguements of the input and method.

* The match also takes into account that parametric methods args needs to have the same type for one T variable. Plus added some printing for parametric methods.

* Lastly I have added so the file and line number for the function also are printed

The following will demo the difference, suppose you have the following methods deffined:
```julia
g(x::Int, args...) = pass
g(x::Int, y::Float64 ,args...) = pass
g(x::Int, y::Float64) = pass
g{T<:Real}(x::T, y::T, z::T) = pass
```
Before you would get:
![image](https://cloud.githubusercontent.com/assets/7973946/5569921/0dc14f48-8f79-11e4-98f6-49b9b61425bb.png)
Where it shows that the parametric type matches all arguments and the second is two arguments from matching but in reality if you change the first argument to an Int then it matches. With this pull-request it displays:
![image](https://cloud.githubusercontent.com/assets/7973946/5569946/468c6830-8f79-11e4-84bb-f2593ca3c8f3.png)

@jhasse could you approve/comment on my changes since you are the original author of this, nice work and idea by the way. Also pinging some of the reviewers in #7714 to hear their opinion, @ivarne, @simonster, @mbauman.