Add check for inference of `Nothing`.