Is it? In Rust and other languages you would use trait bounds to restrict the input types to be comparable with each other, which would make this a compile time error.
Making sure you can compare the types is already happening in the compiler, and doesn't find the bug.
Making sure you can compare the types is already happening in the compiler, and doesn't find the bug.