$21 GRAYBYTE WORDPRESS FILE MANAGER $99

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/cmd/compile/internal/types2/

HOME
Current File : /usr/lib/golang/src/cmd/compile/internal/types2//api_predicates.go
// Copyright 2023 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.

// This file implements exported type predicates.

package types2

// AssertableTo reports whether a value of type V can be asserted to have type T.
//
// The behavior of AssertableTo is unspecified in three cases:
//   - if T is Typ[Invalid]
//   - if V is a generalized interface; i.e., an interface that may only be used
//     as a type constraint in Go code
//   - if T is an uninstantiated generic type
func AssertableTo(V *Interface, T Type) bool {
	// Checker.newAssertableTo suppresses errors for invalid types, so we need special
	// handling here.
	if !isValid(T.Underlying()) {
		return false
	}
	return (*Checker)(nil).newAssertableTo(V, T, nil)
}

// AssignableTo reports whether a value of type V is assignable to a variable
// of type T.
//
// The behavior of AssignableTo is unspecified if V or T is Typ[Invalid] or an
// uninstantiated generic type.
func AssignableTo(V, T Type) bool {
	x := operand{mode: value, typ: V}
	ok, _ := x.assignableTo(nil, T, nil) // check not needed for non-constant x
	return ok
}

// ConvertibleTo reports whether a value of type V is convertible to a value of
// type T.
//
// The behavior of ConvertibleTo is unspecified if V or T is Typ[Invalid] or an
// uninstantiated generic type.
func ConvertibleTo(V, T Type) bool {
	x := operand{mode: value, typ: V}
	return x.convertibleTo(nil, T, nil) // check not needed for non-constant x
}

// Implements reports whether type V implements interface T.
//
// The behavior of Implements is unspecified if V is Typ[Invalid] or an uninstantiated
// generic type.
func Implements(V Type, T *Interface) bool {
	if T.Empty() {
		// All types (even Typ[Invalid]) implement the empty interface.
		return true
	}
	// Checker.implements suppresses errors for invalid types, so we need special
	// handling here.
	if !isValid(V.Underlying()) {
		return false
	}
	return (*Checker)(nil).implements(V, T, false, nil)
}

// Satisfies reports whether type V satisfies the constraint T.
//
// The behavior of Satisfies is unspecified if V is Typ[Invalid] or an uninstantiated
// generic type.
func Satisfies(V Type, T *Interface) bool {
	return (*Checker)(nil).implements(V, T, true, nil)
}

// Identical reports whether x and y are identical types.
// Receivers of [Signature] types are ignored.
//
// Predicates such as [Identical], [Implements], and
// [Satisfies] assume that both operands belong to a
// consistent collection of symbols ([Object] values).
// For example, two [Named] types can be identical only if their
// [Named.Obj] methods return the same [TypeName] symbol.
// A collection of symbols is consistent if, for each logical
// package whose path is P, the creation of those symbols
// involved at most one call to [NewPackage](P, ...).
// To ensure consistency, use a single [Importer] for
// all loaded packages and their dependencies.
// For more information, see https://github.com/golang/go/issues/57497.
func Identical(x, y Type) bool {
	var c comparer
	return c.identical(x, y, nil)
}

// IdenticalIgnoreTags reports whether x and y are identical types if tags are ignored.
// Receivers of [Signature] types are ignored.
func IdenticalIgnoreTags(x, y Type) bool {
	var c comparer
	c.ignoreTags = true
	return c.identical(x, y, nil)
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Dec 2025 6.06 PM
root / root
0755
README.md
4.551 KB
4 Dec 2025 6.06 PM
root / root
0644
alias.go
5.962 KB
4 Dec 2025 6.06 PM
root / root
0644
api.go
17.76 KB
4 Dec 2025 6.06 PM
root / root
0644
api_predicates.go
3.321 KB
4 Dec 2025 6.06 PM
root / root
0644
array.go
0.784 KB
4 Dec 2025 6.06 PM
root / root
0644
assignments.go
16.821 KB
4 Dec 2025 6.06 PM
root / root
0644
basic.go
1.484 KB
4 Dec 2025 6.06 PM
root / root
0644
builtins.go
29.327 KB
4 Dec 2025 6.06 PM
root / root
0644
call.go
31.94 KB
4 Dec 2025 6.06 PM
root / root
0644
chan.go
0.889 KB
4 Dec 2025 6.06 PM
root / root
0644
check.go
21.714 KB
4 Dec 2025 6.06 PM
root / root
0644
compiler_internal.go
1.362 KB
4 Dec 2025 6.06 PM
root / root
0644
compilersupport.go
1.295 KB
4 Dec 2025 6.06 PM
root / root
0644
const.go
7.528 KB
4 Dec 2025 6.06 PM
root / root
0644
context.go
4.306 KB
4 Dec 2025 6.06 PM
root / root
0644
conversions.go
8.955 KB
4 Dec 2025 6.06 PM
root / root
0644
decl.go
29.765 KB
4 Dec 2025 6.06 PM
root / root
0644
errors.go
6.594 KB
4 Dec 2025 6.06 PM
root / root
0644
errsupport.go
4.402 KB
4 Dec 2025 6.06 PM
root / root
0644
expr.go
41.219 KB
4 Dec 2025 6.06 PM
root / root
0644
format.go
3.931 KB
4 Dec 2025 6.06 PM
root / root
0644
gccgosizes.go
1.017 KB
4 Dec 2025 6.06 PM
root / root
0644
gcsizes.go
4.233 KB
4 Dec 2025 6.06 PM
root / root
0644
index.go
10.974 KB
4 Dec 2025 6.06 PM
root / root
0644
infer.go
27.036 KB
4 Dec 2025 6.06 PM
root / root
0644
initorder.go
10.006 KB
4 Dec 2025 6.06 PM
root / root
0644
instantiate.go
13.105 KB
4 Dec 2025 6.06 PM
root / root
0644
interface.go
6.253 KB
4 Dec 2025 6.06 PM
root / root
0644
labels.go
7.257 KB
4 Dec 2025 6.06 PM
root / root
0644
literals.go
12.751 KB
4 Dec 2025 6.06 PM
root / root
0644
lookup.go
22.531 KB
4 Dec 2025 6.06 PM
root / root
0644
map.go
0.644 KB
4 Dec 2025 6.06 PM
root / root
0644
mono.go
9.09 KB
4 Dec 2025 6.06 PM
root / root
0644
named.go
24.237 KB
4 Dec 2025 6.06 PM
root / root
0644
object.go
21.985 KB
4 Dec 2025 6.06 PM
root / root
0644
objset.go
0.906 KB
4 Dec 2025 6.06 PM
root / root
0644
operand.go
12.072 KB
4 Dec 2025 6.06 PM
root / root
0644
package.go
2.927 KB
4 Dec 2025 6.06 PM
root / root
0644
pointer.go
0.62 KB
4 Dec 2025 6.06 PM
root / root
0644
predicates.go
17.483 KB
4 Dec 2025 6.06 PM
root / root
0644
range.go
9.248 KB
4 Dec 2025 6.06 PM
root / root
0644
recording.go
4.58 KB
4 Dec 2025 6.06 PM
root / root
0644
resolver.go
25.425 KB
4 Dec 2025 6.06 PM
root / root
0644
return.go
4.366 KB
4 Dec 2025 6.06 PM
root / root
0644
scope.go
7.529 KB
4 Dec 2025 6.06 PM
root / root
0644
selection.go
5.781 KB
4 Dec 2025 6.06 PM
root / root
0644
signature.go
16.755 KB
4 Dec 2025 6.06 PM
root / root
0644
sizes.go
8.816 KB
4 Dec 2025 6.06 PM
root / root
0644
slice.go
0.563 KB
4 Dec 2025 6.06 PM
root / root
0644
stmt.go
23.145 KB
4 Dec 2025 6.06 PM
root / root
0644
struct.go
6.564 KB
4 Dec 2025 6.06 PM
root / root
0644
subst.go
10.311 KB
4 Dec 2025 6.06 PM
root / root
0644
termlist.go
3.77 KB
4 Dec 2025 6.06 PM
root / root
0644
tuple.go
0.907 KB
4 Dec 2025 6.06 PM
root / root
0644
type.go
0.309 KB
4 Dec 2025 6.06 PM
root / root
0644
typelists.go
1.842 KB
4 Dec 2025 6.06 PM
root / root
0644
typeparam.go
5.099 KB
4 Dec 2025 6.06 PM
root / root
0644
typeset.go
13.209 KB
4 Dec 2025 6.06 PM
root / root
0644
typestring.go
12.354 KB
4 Dec 2025 6.06 PM
root / root
0644
typeterm.go
3.519 KB
4 Dec 2025 6.06 PM
root / root
0644
typexpr.go
16.229 KB
4 Dec 2025 6.06 PM
root / root
0644
under.go
4.21 KB
4 Dec 2025 6.06 PM
root / root
0644
unify.go
27.768 KB
4 Dec 2025 6.06 PM
root / root
0644
union.go
6.252 KB
4 Dec 2025 6.06 PM
root / root
0644
universe.go
9.233 KB
4 Dec 2025 6.06 PM
root / root
0644
util.go
2.313 KB
4 Dec 2025 6.06 PM
root / root
0644
validtype.go
10.238 KB
4 Dec 2025 6.06 PM
root / root
0644
version.go
2.032 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF