Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for missingMethod (0.15 sec)

  1. src/cmd/compile/internal/types2/lookup.go

    // is not set), MissingMethod only checks that methods of T which are also
    // present in V have matching types (e.g., for a type assertion x.(T) where
    // x is of interface type V).
    func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) {
    	return (*Checker)(nil).missingMethod(V, T, static, Identical, nil)
    }
    
    // missingMethod is like MissingMethod but accepts a *Checker as receiver,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 19.8K bytes
    - Viewed (0)
  2. src/go/types/lookup.go

    // is not set), MissingMethod only checks that methods of T which are also
    // present in V have matching types (e.g., for a type assertion x.(T) where
    // x is of interface type V).
    func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) {
    	return (*Checker)(nil).missingMethod(V, T, static, Identical, nil)
    }
    
    // missingMethod is like MissingMethod but accepts a *Checker as receiver,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 19.9K bytes
    - Viewed (0)
  3. src/runtime/error.go

    	RuntimeError()
    }
    
    // A TypeAssertionError explains a failed type assertion.
    type TypeAssertionError struct {
    	_interface    *_type
    	concrete      *_type
    	asserted      *_type
    	missingMethod string // one method needed by Interface, missing from Concrete
    }
    
    func (*TypeAssertionError) RuntimeError() {}
    
    func (e *TypeAssertionError) Error() string {
    	inter := "interface"
    	if e._interface != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:10:41 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/infer.go

    					//           We leave it as is for now because missingMethod provides
    					//           a failure cause which allows for a better error message.
    					//           Eventually, unify should return an error with cause.
    					var cause string
    					constraint := tpar.iface()
    					if m, _ := check.missingMethod(tx, constraint, true, func(x, y Type) bool { return u.unify(x, y, exact) }, &cause); m != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  5. src/go/types/instantiate.go

    	if Ti.typeSet().IsEmpty() {
    		if cause != nil {
    			*cause = check.sprintf("cannot %s %s (empty type set)", verb, T)
    		}
    		return false
    	}
    
    	// V must implement T's methods, if any.
    	if m, _ := check.missingMethod(V, T, true, Identical, cause); m != nil /* !Implements(V, T) */ {
    		if cause != nil {
    			*cause = check.sprintf("%s does not %s %s %s", V, verb, T, *cause)
    		}
    		return false
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  6. src/go/types/infer.go

    					//           We leave it as is for now because missingMethod provides
    					//           a failure cause which allows for a better error message.
    					//           Eventually, unify should return an error with cause.
    					var cause string
    					constraint := tpar.iface()
    					if m, _ := check.missingMethod(tx, constraint, true, func(x, y Type) bool { return u.unify(x, y, exact) }, &cause); m != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/instantiate.go

    	if Ti.typeSet().IsEmpty() {
    		if cause != nil {
    			*cause = check.sprintf("cannot %s %s (empty type set)", verb, T)
    		}
    		return false
    	}
    
    	// V must implement T's methods, if any.
    	if m, _ := check.missingMethod(V, T, true, Identical, cause); m != nil /* !Implements(V, T) */ {
    		if cause != nil {
    			*cause = check.sprintf("%s does not %s %s %s", V, verb, T, *cause)
    		}
    		return false
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  8. src/runtime/iface.go

    	// The cached result doesn't record which
    	// interface function was missing, so initialize
    	// the itab again to get the missing function name.
    	panic(&TypeAssertionError{concrete: typ, asserted: &inter.Type, missingMethod: itabInit(m, false)})
    }
    
    // find finds the given interface/type pair in t.
    // Returns nil if the given interface/type pair isn't present.
    func (t *itabTableType) find(inter *interfacetype, typ *_type) *itab {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 22.5K bytes
    - Viewed (0)
Back to top