What exactly is the meaning of ```!Matched``` in ```myFunction(::G,!Matched::M)```?


#1
MethodError: no method matching cG(::G, ::typeof(m))
Closest candidates are:
  cG(::G, !Matched::M) at /home/devel/Desktop/SDP_me/g.jl:77
#initSim#155(::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::String) at run_c.jl:139
(::getfield(J, Symbol("#kw##initSim")))(::NamedTuple{(:doPrint,),Tuple{Bool}}, ::typeof(initSim), ::String) at none:0
top-level scope at none:0

I indeed have the function cG safe and sound. Why can not julia find it?


#2

Please post the code that you are using to call the function, as well as the function itself, to give a MWE (minimum working example).

In this case, it seems that the function has a method that expects to be called with a second argument that is the function m, but the way you called it did not correctly “match” that.


#3

Julia found it in g.jl on line 77. You might need to change a type assertion.


#4

There’s a method, cg(::G, ::M), but you tried to call cg(::G, ::typeof(m)) and !typeof(m) <: M. My best guess it you have a method called m(...), but are also trying to use it as a variable of type M that you then forgot to assign. For more specific help you’ll need to post the code though.