type inference for comparison operator