support for inferMethodInstance

Experimental and dirty, very akin to the parent commit.