Handle named generics on methods

Related to #858