Either "when" or "if" needs to be dropped from statement. Same in docblock for allowEmpty()