The best way to do it would be to implement #2380.