- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for LookupFieldOrMethod (0.72 sec)
-
src/cmd/compile/internal/types2/lookup.go
// the method's formal receiver base type, nor was the receiver addressable. func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool) { if T == nil { panic("LookupFieldOrMethod on nil type") } return lookupFieldOrMethod(T, addressable, pkg, name, false) } // lookupFieldOrMethod is like LookupFieldOrMethod but with the additional foldCase parameter
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
// the method's formal receiver base type, nor was the receiver addressable. func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool) { if T == nil { panic("LookupFieldOrMethod on nil type") } return lookupFieldOrMethod(T, addressable, pkg, name, false) } // lookupFieldOrMethod is like LookupFieldOrMethod but with the additional foldCase parameter
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/go/types/call.go
/// may be other situations. disabled := true if !disabled && debug { // Verify that LookupFieldOrMethod and MethodSet.Lookup agree. // TODO(gri) This only works because we call LookupFieldOrMethod // _before_ calling NewMethodSet: LookupFieldOrMethod completes // any incomplete interfaces so they are available to NewMethodSet
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 33.5K bytes - Viewed (0) -
src/go/internal/gcimporter/gcimporter_test.go
typ, ok := obj.Type().(*types.Named) if !ok { t.Fatalf("go/types.Object type is %v; wanted named type", typ) } // lookup go/types.Object.Pkg method m, index, indirect := types.LookupFieldOrMethod(typ, false, nil, "Pkg") if m == nil { t.Fatalf("go/types.Object.Pkg not found (index = %v, indirect = %v)", index, indirect) } // the method must belong to go/types if m.Pkg().Path() != "go/types" {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 17 16:22:59 UTC 2024 - 21.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
if isFormatter(typ) { return "", false } // Does e allow e.String() or e.Error()? strObj, _, _ := types.LookupFieldOrMethod(typ, false, pass.Pkg, "String") strMethod, strOk := strObj.(*types.Func) errObj, _, _ := types.LookupFieldOrMethod(typ, false, pass.Pkg, "Error") errMethod, errOk := errObj.(*types.Func) if !strOk && !errOk { return "", false }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 32.5K bytes - Viewed (0) -
src/go/types/issues_test.go
} // verify that lookup finds the same method in both interfaces (redundant check) obj, _, _ := LookupFieldOrMethod(et, false, nil, "Error") if obj != want { t.Fatalf("%s.Lookup: got %q (%p); want %q (%p)", et, obj, obj, want, want) } obj, _, _ = LookupFieldOrMethod(it, false, nil, "Error") if obj != want { t.Fatalf("%s.Lookup: got %q (%p); want %q (%p)", it, obj, obj, want, want) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 28.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/issues_test.go
} // verify that lookup finds the same method in both interfaces (redundant check) obj, _, _ := LookupFieldOrMethod(et, false, nil, "Error") if obj != want { t.Fatalf("%s.Lookup: got %q (%p); want %q (%p)", et, obj, obj, want, want) } obj, _, _ = LookupFieldOrMethod(it, false, nil, "Error") if obj != want { t.Fatalf("%s.Lookup: got %q (%p); want %q (%p)", it, obj, obj, want, want) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 28.1K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/tests/tests.go
// Check ExampleFoo_Method and ExampleFoo_BadMethod. found := false // Check if Foo.Method exists in this package or its imports. for _, obj := range objs { if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj != nil { found = true break } } if !found { pass.Reportf(fn.Pos(), "%s refers to unknown field or method: %s.%s", fnName, ident, mmbr) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 03 02:38:00 UTC 2024 - 14.4K bytes - Viewed (0) -
src/cmd/compile/internal/types2/call.go
// x.typ is incomplete. if wantType { check.errorf(e.Sel, NotAType, "%s is not a type", syntax.Expr(e)) goto Error } obj, index, indirect = lookupFieldOrMethod(x.typ, x.mode == variable, check.pkg, sel, false) if obj == nil { // Don't report another error if the underlying type was invalid (go.dev/issue/49541). if !isValid(under(x.typ)) { goto Error }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 31.5K bytes - Viewed (0) -
src/go/types/builtins.go
check.use(arg0) return } check.expr(nil, x, selx.X) if x.mode == invalid { return } base := derefStructPtr(x.typ) sel := selx.Sel.Name obj, index, indirect := lookupFieldOrMethod(base, false, check.pkg, sel, false) switch obj.(type) { case nil: check.errorf(x, MissingFieldOrMethod, invalidArg+"%s has no single field %s", base, sel) return case *Func:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 27.2K bytes - Viewed (0)