Generics: only warn about failed return at runtime when the function actually returns something.