Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for IsMethodApplicable (0.26 sec)

  1. src/cmd/compile/internal/typecheck/subr.go

    			*m = im
    			*samename = tm
    			*ptr = 0
    			return false
    		}
    
    		// if pointer receiver in method,
    		// the method does not exist for value types.
    		if !types.IsMethodApplicable(t0, tm) {
    			if false && base.Flag.LowerR != 0 {
    				base.Errorf("interface pointer mismatch")
    			}
    
    			*m = im
    			*samename = nil
    			*ptr = 1
    			return false
    		}
    	}
    
    	return true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 19:45:58 UTC 2023
    - 20.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types/type.go

    func IsInterfaceMethod(f *Type) bool {
    	return f.Recv().Type == FakeRecvType()
    }
    
    // IsMethodApplicable reports whether method m can be called on a
    // value of type t. This is necessary because we compute a single
    // method set for both T and *T, but some *T methods are not
    // applicable to T receivers.
    func IsMethodApplicable(t *Type, m *Field) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/typecheck.go

    		}
    		CalcMethods(mt)
    		ms = mt.AllMethods()
    	}
    
    	m := Lookdot1(nil, sym, recv, ms, 0)
    	if m == nil {
    		base.FatalfAt(pos, "type %v has no method %v", recv, sym)
    	}
    
    	if !types.IsMethodApplicable(recv, m) {
    		base.FatalfAt(pos, "invalid method expression %v.%v (needs pointer receiver)", recv, sym)
    	}
    
    	n := ir.NewSelectorExpr(pos, ir.OMETHEXPR, ir.TypeNode(recv), sym)
    	n.Selection = m
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
Back to top