- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for assertableTo (0.18 sec)
-
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/ifaceassert.go
Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, } // assertableTo checks whether interface v can be asserted into t. It returns // nil on success, or the first conflicting method on failure. func assertableTo(free *typeparams.Free, v, t types.Type) *types.Func { if t == nil || v == nil { // not assertable to, but there is no missing method return nil } // ensure that v and t are interfaces
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 2.8K bytes - Viewed (0) -
src/cmd/compile/internal/types2/api_predicates.go
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 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 08 16:36:08 UTC 2024 - 3.3K bytes - Viewed (0) -
src/go/types/api_predicates.go
package types // 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 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 08 16:36:08 UTC 2024 - 3.5K bytes - Viewed (0) -
src/cmd/compile/internal/types2/lookup.go
w.pkgInfo = pkgInfo w.paramNames = false w.signature(f.typ.(*Signature)) return buf.String() } // assertableTo reports whether a value of type V can be asserted to have type T. // The receiver may be nil if assertableTo is invoked through an exported API call // (such as AssertableTo), i.e., when all methods have been type-checked. // The underlying type of V must be an interface.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 22 19:32:17 UTC 2024 - 19.8K bytes - Viewed (0) -
src/go/types/lookup.go
w.pkgInfo = pkgInfo w.paramNames = false w.signature(f.typ.(*Signature)) return buf.String() } // assertableTo reports whether a value of type V can be asserted to have type T. // The receiver may be nil if assertableTo is invoked through an exported API call // (such as AssertableTo), i.e., when all methods have been type-checked. // The underlying type of V must be an interface.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 19.9K bytes - Viewed (0) -
src/cmd/compile/internal/types2/api_test.go
V := test.T T := test.V want := false if _, ok := T.Underlying().(*Interface); (ok || Implements(T, V)) && T != Bad { want = true } if got := AssertableTo(V, T); got != want { t.Errorf("AssertableTo(%s, %s) = %t, want %t", V, T, got, want) } } } func TestMissingMethodAlternative(t *testing.T) { const src = ` package p type T interface { m() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 07 20:08:23 UTC 2024 - 93.3K bytes - Viewed (0) -
src/go/types/api_test.go
V := test.T T := test.V want := false if _, ok := T.Underlying().(*Interface); (ok || Implements(T, V)) && T != Bad { want = true } if got := AssertableTo(V, T); got != want { t.Errorf("AssertableTo(%s, %s) = %t, want %t", V, T, got, want) } } } func TestMissingMethodAlternative(t *testing.T) { const src = ` package p type T interface { m() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 94.2K bytes - Viewed (0) -
src/go/types/expr.go
} return x } // typeAssertion checks x.(T). The type of x must be an interface. func (check *Checker) typeAssertion(e ast.Expr, x *operand, T Type, typeSwitch bool) { var cause string if check.assertableTo(x.typ, T, &cause) { return // success } if typeSwitch { check.errorf(e, ImpossibleAssert, "impossible type switch case: %s\n\t%s cannot have dynamic type %s %s", e, x, T, cause) return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 49.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/expr.go
} return x } // typeAssertion checks x.(T). The type of x must be an interface. func (check *Checker) typeAssertion(e syntax.Expr, x *operand, T Type, typeSwitch bool) { var cause string if check.assertableTo(x.typ, T, &cause) { return // success } if typeSwitch { check.errorf(e, ImpossibleAssert, "impossible type switch case: %s\n\t%s cannot have dynamic type %s %s", e, x, T, cause) return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 51.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"(TypeAndValue).IsVoid", Method, 5}, {"Alias", Type, 22}, {"ArgumentError", Type, 18}, {"ArgumentError.Err", Field, 18}, {"ArgumentError.Index", Field, 18}, {"Array", Type, 5}, {"AssertableTo", Func, 5}, {"AssignableTo", Func, 5}, {"Basic", Type, 5}, {"BasicInfo", Type, 5}, {"BasicKind", Type, 5}, {"Bool", Const, 5}, {"Builtin", Type, 5}, {"Byte", Const, 5},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)