Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for LookupFieldOrMethod (0.37 sec)

  1. src/go/types/lookup_test.go

    package types_test
    
    import (
    	"go/importer"
    	"go/token"
    	"path/filepath"
    	"runtime"
    	"testing"
    
    	. "go/types"
    )
    
    // BenchmarkLookupFieldOrMethod measures types.LookupFieldOrMethod performance.
    // LookupFieldOrMethod is a performance hotspot for both type-checking and
    // external API calls.
    func BenchmarkLookupFieldOrMethod(b *testing.B) {
    	// Choose an arbitrary, large package.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 13 15:31:43 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  2. src/go/types/instantiate_test.go

    	for _, test := range tests {
    		src := prefix + test.decl
    		pkg := mustTypecheck(src, nil, nil)
    		typ := NewPointer(pkg.Scope().Lookup("X").Type())
    		obj, _, _ := LookupFieldOrMethod(typ, false, pkg, "m")
    		m, _ := obj.(*Func)
    		if m == nil {
    			t.Fatalf(`LookupFieldOrMethod(%s, "m") = %v, want func m`, typ, obj)
    		}
    		if got := ObjectString(m, RelativeTo(pkg)); got != test.want {
    			t.Errorf("instantiated %q, want %q", got, test.want)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/lookup_test.go

    package types2_test
    
    import (
    	"path/filepath"
    	"runtime"
    	"testing"
    
    	. "cmd/compile/internal/types2"
    )
    
    // BenchmarkLookupFieldOrMethod measures types.LookupFieldOrMethod performance.
    // LookupFieldOrMethod is a performance hotspot for both type-checking and
    // external API calls.
    func BenchmarkLookupFieldOrMethod(b *testing.B) {
    	// Choose an arbitrary, large package.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 13 15:31:35 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/instantiate_test.go

    	for _, test := range tests {
    		src := prefix + test.decl
    		pkg := mustTypecheck(src, nil, nil)
    		typ := NewPointer(pkg.Scope().Lookup("X").Type())
    		obj, _, _ := LookupFieldOrMethod(typ, false, pkg, "m")
    		m, _ := obj.(*Func)
    		if m == nil {
    			t.Fatalf(`LookupFieldOrMethod(%s, "m") = %v, want func m`, typ, obj)
    		}
    		if got := ObjectString(m, RelativeTo(pkg)); got != test.want {
    			t.Errorf("instantiated %q, want %q", got, test.want)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 28 17:58:07 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. src/go/types/methodset.go

    //       internally if LookupFieldOrMethod completed the same
    //       interfaces beforehand.
    
    // NewMethodSet returns the method set for the given type T.
    // It always returns a non-nil method set, even if it is empty.
    func NewMethodSet(T Type) *MethodSet {
    	// WARNING: The code in this function is extremely subtle - do not modify casually!
    	//          This function and lookupFieldOrMethod should be kept in sync.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/internal/typesinternal/toonew.go

    			if t := pkg.Scope().Lookup(typename); t != nil && disallowed[t] == "" {
    				obj, _, _ = types.LookupFieldOrMethod(t.Type(), false, pkg, name)
    			}
    
    		case stdlib.Method:
    			ptr, recvname, name := sym.SplitMethod()
    			if t := pkg.Scope().Lookup(recvname); t != nil && disallowed[t] == "" {
    				obj, _, _ = types.LookupFieldOrMethod(t.Type(), ptr, pkg, name)
    			}
    		}
    		if obj != nil {
    			disallowed[obj] = symVersion
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/object_test.go

    	// get original error.Error method
    	eface := Universe.Lookup("error")
    	orig, _, _ := LookupFieldOrMethod(eface.Type(), false, nil, "Error")
    	if orig == nil {
    		t.Fatalf("original error.Error not found")
    	}
    
    	// get embedded error.Error method
    	iface := pkg.Scope().Lookup("I")
    	embed, _, _ := LookupFieldOrMethod(iface.Type(), false, nil, "Error")
    	if embed == nil {
    		t.Fatalf("embedded error.Error not found")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  10. src/go/types/object_test.go

    	// get original error.Error method
    	eface := Universe.Lookup("error")
    	orig, _, _ := LookupFieldOrMethod(eface.Type(), false, nil, "Error")
    	if orig == nil {
    		t.Fatalf("original error.Error not found")
    	}
    
    	// get embedded error.Error method
    	iface := pkg.Scope().Lookup("I")
    	embed, _, _ := LookupFieldOrMethod(iface.Type(), false, nil, "Error")
    	if embed == nil {
    		t.Fatalf("embedded error.Error not found")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
Back to top