fixes strange error messages for invalid generic method definitions