Fixed a return type resolution bug that was caused by having a return type that is also a generic parameter of a generic type