Here you have to carefully read the code to figure out what is assigned to `warnFun`. I think being a little more verbose makes the code easier to read:

```R
i <- (selected %in% nms) & !(selected %in% choices))
if (any(i)) {
  # replace names with values; drop names, otherwise toJSON() keeps them too 
  selected <- unname(choices[selected])
  warnFun <- warning
} else {
  warnFun <- stop
}
```