Resolve generic types before comparing method return type and parameter types.