better handling of ... in `@which`. fixes #5173