if !isTypeParam(x.typ) {
errOp = y
}
- cause = check.sprintf("type parameter %s is not comparable with %s", errOp.typ, op)
+ cause = check.sprintf("type parameter %s cannot use operator %s", errOp.typ, op)
} else {
cause = check.sprintf("operator %s not defined on %s", op, check.kindString(errOp.typ)) // catch-all
}
if !isTypeParam(x.typ) {
errOp = y
}
- cause = check.sprintf("type parameter %s is not comparable with %s", errOp.typ, op)
+ cause = check.sprintf("type parameter %s cannot use operator %s", errOp.typ, op)
} else {
cause = check.sprintf("operator %s not defined on %s", op, check.kindString(errOp.typ)) // catch-all
}
}
func _[T interface{~int | ~float32}](x, y T) bool { return x < y }
-func _[T any](x, y T) bool { return x /* ERROR "type parameter T is not comparable" */ < y }
-func _[T interface{~int | ~float32 | ~bool}](x, y T) bool { return x /* ERROR "type parameter T is not comparable" */ < y }
+func _[T any](x, y T) bool { return x /* ERROR "type parameter T cannot use operator <" */ < y }
+func _[T interface{~int | ~float32 | ~bool}](x, y T) bool { return x /* ERROR "type parameter T cannot use operator <" */ < y }
-func _[T C1[T]](x, y T) bool { return x /* ERROR "type parameter T is not comparable" */ < y }
+func _[T C1[T]](x, y T) bool { return x /* ERROR "type parameter T cannot use operator <" */ < y }
func _[T C2[T]](x, y T) bool { return x < y }
type C1[T any] interface{}
_ = y == x
_ = y == y
- _ = x /* ERROR "type parameter P is not comparable with <" */ < y
+ _ = x /* ERROR "type parameter P cannot use operator <" */ < y
}
func _[P comparable](x P, y any) {
_ = y == x
_ = y == y
- _ = x /* ERROR "type parameter P is not comparable with <" */ < y
+ _ = x /* ERROR "type parameter P cannot use operator <" */ < y
}
func _[P any](x, y P) {
_ = y /* ERROR "incomparable types in type set" */ == x
_ = y /* ERROR "incomparable types in type set" */ == y
- _ = x /* ERROR "type parameter P is not comparable with <" */ < y
+ _ = x /* ERROR "type parameter P cannot use operator <" */ < y
}
func _[P any](x P, y any) {
_ = y == x // ERROR "incomparable types in type set"
_ = y == y
- _ = x /* ERROR "type parameter P is not comparable with <" */ < y
+ _ = x /* ERROR "type parameter P cannot use operator <" */ < y
}
_ = c == nil
_ = b < b
- _ = a /* ERROR "type parameter A is not comparable with <" */ < a
- _ = l /* ERROR "type parameter L is not comparable with <" */ < l
- _ = s /* ERROR "type parameter S is not comparable with <" */ < s
- _ = p /* ERROR "type parameter P is not comparable with <" */ < p
- _ = f /* ERROR "type parameter F is not comparable with <" */ < f
- _ = i /* ERROR "type parameter I is not comparable with <" */ < i
- _ = j /* ERROR "type parameter J is not comparable with <" */ < j
- _ = m /* ERROR "type parameter M is not comparable with <" */ < m
- _ = c /* ERROR "type parameter C is not comparable with <" */ < c
+ _ = a /* ERROR "type parameter A cannot use operator <" */ < a
+ _ = l /* ERROR "type parameter L cannot use operator <" */ < l
+ _ = s /* ERROR "type parameter S cannot use operator <" */ < s
+ _ = p /* ERROR "type parameter P cannot use operator <" */ < p
+ _ = f /* ERROR "type parameter F cannot use operator <" */ < f
+ _ = i /* ERROR "type parameter I cannot use operator <" */ < i
+ _ = j /* ERROR "type parameter J cannot use operator <" */ < j
+ _ = m /* ERROR "type parameter M cannot use operator <" */ < m
+ _ = c /* ERROR "type parameter C cannot use operator <" */ < c
}