- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for IsComparable (0.13 sec)
-
src/errors/wrap.go
// compare err and the target and not call [Unwrap] on either. func Is(err, target error) bool { if err == nil || target == nil { return err == target } isComparable := reflectlite.TypeOf(target).Comparable() return is(err, target, isComparable) } func is(err, target error, targetComparable bool) bool { for { if targetComparable && err == target { return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 17:13:04 UTC 2024 - 4.3K bytes - Viewed (0) -
src/go/types/typeset.go
// IsMethodSet reports whether the interface t is fully described by its method set. func (s *_TypeSet) IsMethodSet() bool { return !s.comparable && s.terms.isAll() } // IsComparable reports whether each type in the set is comparable. func (s *_TypeSet) IsComparable(seen map[Type]bool) bool { if s.terms.isAll() { return s.comparable } return s.is(func(t *term) bool { return t != nil && comparable(t.typ, false, seen, nil) }) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 13.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/typeset.go
// IsMethodSet reports whether the interface t is fully described by its method set. func (s *_TypeSet) IsMethodSet() bool { return !s.comparable && s.terms.isAll() } // IsComparable reports whether each type in the set is comparable. func (s *_TypeSet) IsComparable(seen map[Type]bool) bool { if s.terms.isAll() { return s.comparable } return s.is(func(t *term) bool { return t != nil && comparable(t.typ, false, seen, nil) }) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 13.6K bytes - Viewed (0) -
src/go/types/instantiate.go
*cause = check.sprintf("%s does not %s %s %s", V, verb, T, *cause) } return false } // Only check comparability if we don't have a more specific error. checkComparability := func() bool { if !Ti.IsComparable() { return true } // If T is comparable, V must be comparable. // If V is strictly comparable, we're done. if comparable(V, false /* strict comparability */, nil, nil) { return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 12.8K bytes - Viewed (0) -
src/cmd/compile/internal/types2/instantiate.go
*cause = check.sprintf("%s does not %s %s %s", V, verb, T, *cause) } return false } // Only check comparability if we don't have a more specific error. checkComparability := func() bool { if !Ti.IsComparable() { return true } // If T is comparable, V must be comparable. // If V is strictly comparable, we're done. if comparable(V, false /* strict comparability */, nil, nil) { return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 12.7K bytes - Viewed (0) -
src/go/types/predicates.go
if reportf != nil { reportf("%s cannot be compared", t) } return false } return true case *Interface: if dynamic && !isTypeParam(T) || t.typeSet().IsComparable(seen) { return true } if reportf != nil { if t.typeSet().IsEmpty() { reportf("empty type set") } else { reportf("incomparable types in type set") } } // fallthrough
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 17.6K bytes - Viewed (0) -
src/cmd/compile/internal/types2/predicates.go
if reportf != nil { reportf("%s cannot be compared", t) } return false } return true case *Interface: if dynamic && !isTypeParam(T) || t.typeSet().IsComparable(seen) { return true } if reportf != nil { if t.typeSet().IsEmpty() { reportf("empty type set") } else { reportf("incomparable types in type set") } } // fallthrough
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 17.5K bytes - Viewed (0)