Allow uint discriminants. Fixes #7994.