mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-10-19 13:49:53 +00:00
593d9c3b60
Bumps the github-dependencies group with 4 updates: [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go), [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2), [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) and [github.com/onsi/gomega](https://github.com/onsi/gomega). Updates `github.com/aws/aws-sdk-go` from 1.47.4 to 1.47.10 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.47.4...v1.47.10) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.25.0 to 1.25.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/ecs/v1.25.1/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.25.0...service/ecs/v1.25.1) Updates `github.com/onsi/ginkgo/v2` from 2.13.0 to 2.13.1 - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.13.0...v2.13.1) Updates `github.com/onsi/gomega` from 1.29.0 to 1.30.0 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
170 lines
3.6 KiB
Go
170 lines
3.6 KiB
Go
// Copyright 2021 The Go Authors. All rights reserved.
|
||
// Use of this source code is governed by a BSD-style
|
||
// license that can be found in the LICENSE file.
|
||
|
||
// Code generated by copytermlist.go DO NOT EDIT.
|
||
|
||
package typeparams
|
||
|
||
import "go/types"
|
||
|
||
// A term describes elementary type sets:
|
||
//
|
||
// ∅: (*term)(nil) == ∅ // set of no types (empty set)
|
||
// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse)
|
||
// T: &term{false, T} == {T} // set of type T
|
||
// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t
|
||
type term struct {
|
||
tilde bool // valid if typ != nil
|
||
typ types.Type
|
||
}
|
||
|
||
func (x *term) String() string {
|
||
switch {
|
||
case x == nil:
|
||
return "∅"
|
||
case x.typ == nil:
|
||
return "𝓤"
|
||
case x.tilde:
|
||
return "~" + x.typ.String()
|
||
default:
|
||
return x.typ.String()
|
||
}
|
||
}
|
||
|
||
// equal reports whether x and y represent the same type set.
|
||
func (x *term) equal(y *term) bool {
|
||
// easy cases
|
||
switch {
|
||
case x == nil || y == nil:
|
||
return x == y
|
||
case x.typ == nil || y.typ == nil:
|
||
return x.typ == y.typ
|
||
}
|
||
// ∅ ⊂ x, y ⊂ 𝓤
|
||
|
||
return x.tilde == y.tilde && types.Identical(x.typ, y.typ)
|
||
}
|
||
|
||
// union returns the union x ∪ y: zero, one, or two non-nil terms.
|
||
func (x *term) union(y *term) (_, _ *term) {
|
||
// easy cases
|
||
switch {
|
||
case x == nil && y == nil:
|
||
return nil, nil // ∅ ∪ ∅ == ∅
|
||
case x == nil:
|
||
return y, nil // ∅ ∪ y == y
|
||
case y == nil:
|
||
return x, nil // x ∪ ∅ == x
|
||
case x.typ == nil:
|
||
return x, nil // 𝓤 ∪ y == 𝓤
|
||
case y.typ == nil:
|
||
return y, nil // x ∪ 𝓤 == 𝓤
|
||
}
|
||
// ∅ ⊂ x, y ⊂ 𝓤
|
||
|
||
if x.disjoint(y) {
|
||
return x, y // x ∪ y == (x, y) if x ∩ y == ∅
|
||
}
|
||
// x.typ == y.typ
|
||
|
||
// ~t ∪ ~t == ~t
|
||
// ~t ∪ T == ~t
|
||
// T ∪ ~t == ~t
|
||
// T ∪ T == T
|
||
if x.tilde || !y.tilde {
|
||
return x, nil
|
||
}
|
||
return y, nil
|
||
}
|
||
|
||
// intersect returns the intersection x ∩ y.
|
||
func (x *term) intersect(y *term) *term {
|
||
// easy cases
|
||
switch {
|
||
case x == nil || y == nil:
|
||
return nil // ∅ ∩ y == ∅ and ∩ ∅ == ∅
|
||
case x.typ == nil:
|
||
return y // 𝓤 ∩ y == y
|
||
case y.typ == nil:
|
||
return x // x ∩ 𝓤 == x
|
||
}
|
||
// ∅ ⊂ x, y ⊂ 𝓤
|
||
|
||
if x.disjoint(y) {
|
||
return nil // x ∩ y == ∅ if x ∩ y == ∅
|
||
}
|
||
// x.typ == y.typ
|
||
|
||
// ~t ∩ ~t == ~t
|
||
// ~t ∩ T == T
|
||
// T ∩ ~t == T
|
||
// T ∩ T == T
|
||
if !x.tilde || y.tilde {
|
||
return x
|
||
}
|
||
return y
|
||
}
|
||
|
||
// includes reports whether t ∈ x.
|
||
func (x *term) includes(t types.Type) bool {
|
||
// easy cases
|
||
switch {
|
||
case x == nil:
|
||
return false // t ∈ ∅ == false
|
||
case x.typ == nil:
|
||
return true // t ∈ 𝓤 == true
|
||
}
|
||
// ∅ ⊂ x ⊂ 𝓤
|
||
|
||
u := t
|
||
if x.tilde {
|
||
u = under(u)
|
||
}
|
||
return types.Identical(x.typ, u)
|
||
}
|
||
|
||
// subsetOf reports whether x ⊆ y.
|
||
func (x *term) subsetOf(y *term) bool {
|
||
// easy cases
|
||
switch {
|
||
case x == nil:
|
||
return true // ∅ ⊆ y == true
|
||
case y == nil:
|
||
return false // x ⊆ ∅ == false since x != ∅
|
||
case y.typ == nil:
|
||
return true // x ⊆ 𝓤 == true
|
||
case x.typ == nil:
|
||
return false // 𝓤 ⊆ y == false since y != 𝓤
|
||
}
|
||
// ∅ ⊂ x, y ⊂ 𝓤
|
||
|
||
if x.disjoint(y) {
|
||
return false // x ⊆ y == false if x ∩ y == ∅
|
||
}
|
||
// x.typ == y.typ
|
||
|
||
// ~t ⊆ ~t == true
|
||
// ~t ⊆ T == false
|
||
// T ⊆ ~t == true
|
||
// T ⊆ T == true
|
||
return !x.tilde || y.tilde
|
||
}
|
||
|
||
// disjoint reports whether x ∩ y == ∅.
|
||
// x.typ and y.typ must not be nil.
|
||
func (x *term) disjoint(y *term) bool {
|
||
if debug && (x.typ == nil || y.typ == nil) {
|
||
panic("invalid argument(s)")
|
||
}
|
||
ux := x.typ
|
||
if y.tilde {
|
||
ux = under(ux)
|
||
}
|
||
uy := y.typ
|
||
if x.tilde {
|
||
uy = under(uy)
|
||
}
|
||
return !types.Identical(ux, uy)
|
||
}
|