Fix distinct keyword on non-comparable type

Solves issue 1931