Add convenience method for checking the inferred return type of a function