better type handling for variant cases with any pattern