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.
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.