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

MethodError message misleading/wrong on 0.4, very hard to read on 0.5 #15639

Closed
IainNZ opened this issue Mar 27, 2016 · 1 comment · Fixed by #16669
Closed

MethodError message misleading/wrong on 0.4, very hard to read on 0.5 #15639

IainNZ opened this issue Mar 27, 2016 · 1 comment · Fixed by #16669
Labels
error handling Handling of exceptions by Julia or the user

Comments

@IainNZ
Copy link
Member

IainNZ commented Mar 27, 2016

Reproduce with

type FooCon
    x
end
type BarCon
    x
end
function addConstraint(c::FooCon)
    println("addCon(FooCon)")
end
function addConstraint(c::BarCon; uncset=nothing)
    println("addCon(BarCon,$uncset)")
    # Oh, BarCon was suppossed to be a FooCon, let me erroneously pass
    # on this kwarg which isn't supported
    addConstraint(FooCon(c.x), uncset=uncset)
end
addConstraint(BarCon(1))

On Julia 0.4.5:

ERROR: LoadError: MethodError: `addConstraint` has no method matching addConstraint(::FooCon)
Closest candidates are:
  addConstraint(::FooCon)
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:280
 in _start at ./client.jl:378

Julia 0.5 (from January 31st)

ERROR: LoadError: MethodError: `#addConstraint` has no method matching #addConstraint(::Array{Any,1}, ::#addConstraint, ::FooCon)
Closest candidates are:
  #addConstraint(::Array{T,N}, ::#addConstraint, ::BarCon)
 [inlined code] from ./boot.jl:331
 in #addConstraint#1(##addConstraint#1, Void, Any, BarCon) at /Users/idunning/.julia/v0.4/JuMPeR/rep.jl:14
 in include(Core.#include, ASCIIString) at ./boot.jl:264
 in include_from_node1 at ./loading.jl:417
 in process_options at ./client.jl:244
 in _start at ./client.jl:300
@tkelman tkelman added the error handling Handling of exceptions by Julia or the user label Mar 27, 2016
dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the mismatch in keywords. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the mismatch in keywords. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the mismatch in keywords. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the mismatch in keywords. Fix JuliaLang#15639
@dhoegh
Copy link
Contributor

dhoegh commented May 30, 2016

I have implemented a fix for this, see #16669.

dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 30, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 31, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 31, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue May 31, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue Jun 4, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue Jun 5, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue Jun 5, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue Jun 5, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
dhoegh added a commit to dhoegh/julia that referenced this issue Jun 26, 2016
…method in show_method_candidates with a text stating the not matching keyword. Fix JuliaLang#15639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants