X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/compile/internal/types2
opt
/
golang
/
1.19.4
/
src
/
cmd
/
compile
/
internal
/
types2
/
π
..
π
api.go
(17.37 KB)
π
api_test.go
(79.44 KB)
π
array.go
(803 B)
π
assignments.go
(13.89 KB)
π
basic.go
(1.48 KB)
π
builtins.go
(23.73 KB)
π
builtins_test.go
(9.89 KB)
π
call.go
(19.08 KB)
π
chan.go
(910 B)
π
check.go
(17.12 KB)
π
check_test.go
(8.96 KB)
π
compilersupport.go
(1.05 KB)
π
context.go
(4.34 KB)
π
context_test.go
(2.3 KB)
π
conversions.go
(8.27 KB)
π
decl.go
(27.86 KB)
π
errorcalls_test.go
(1.15 KB)
π
errors.go
(7.62 KB)
π
errors_test.go
(1.01 KB)
π
example_test.go
(7.41 KB)
π
expr.go
(54.01 KB)
π
gccgosizes.go
(1017 B)
π
hilbert_test.go
(3.63 KB)
π
importer_test.go
(913 B)
π
index.go
(11.13 KB)
π
infer.go
(24.86 KB)
π
initorder.go
(9.55 KB)
π
instantiate.go
(9.93 KB)
π
instantiate_test.go
(5.98 KB)
π
interface.go
(6.04 KB)
π
issues_test.go
(17.4 KB)
π
labels.go
(7.05 KB)
π
lookup.go
(17.01 KB)
π
main_test.go
(336 B)
π
map.go
(659 B)
π
mono.go
(9.03 KB)
π
mono_test.go
(2.65 KB)
π
named.go
(22.4 KB)
π
named_test.go
(2.35 KB)
π
object.go
(18.8 KB)
π
object_test.go
(5.13 KB)
π
objset.go
(928 B)
π
operand.go
(10.62 KB)
π
package.go
(2.67 KB)
π
pointer.go
(635 B)
π
predicates.go
(14.64 KB)
π
resolver.go
(24.88 KB)
π
resolver_test.go
(4.81 KB)
π
return.go
(4.34 KB)
π
scope.go
(9.38 KB)
π
selection.go
(3.99 KB)
π
self_test.go
(2.58 KB)
π
signature.go
(12.1 KB)
π
sizeof_test.go
(1.28 KB)
π
sizes.go
(7.56 KB)
π
sizes_test.go
(3.25 KB)
π
slice.go
(577 B)
π
stdlib_test.go
(8.8 KB)
π
stmt.go
(25.66 KB)
π
struct.go
(6.24 KB)
π
subst.go
(10.78 KB)
π
termlist.go
(3.68 KB)
π
termlist_test.go
(7.18 KB)
π
testdata
π
tuple.go
(929 B)
π
type.go
(2.92 KB)
π
typelists.go
(1.84 KB)
π
typeparam.go
(4.75 KB)
π
typeset.go
(13.87 KB)
π
typeset_test.go
(2.41 KB)
π
typestring.go
(10.61 KB)
π
typestring_test.go
(4.11 KB)
π
typeterm.go
(3.52 KB)
π
typeterm_test.go
(5.08 KB)
π
typexpr.go
(14.8 KB)
π
unify.go
(18.34 KB)
π
union.go
(6.1 KB)
π
universe.go
(7.58 KB)
π
validtype.go
(7.77 KB)
π
version.go
(2.13 KB)
Editing: typeterm.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. package types2 // 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 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 && 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 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 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 !Identical(ux, uy) }
Upload File
Create Folder