Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CanRecv (0.07 sec)

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

    	if t == nil {
    		n.SetType(nil)
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (receive from non-chan type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	if !t.ChanDir().CanRecv() {
    		base.Errorf("invalid operation: %v (receive from send-only type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	n.SetType(t.Elem())
    	return n
    }
    
    // tcSPtr typechecks an OSPTR node.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types/type.go

    	TRESULTS // multiple types; the result of calling a function or method, with a memory at the end.
    
    	NTYPE
    )
    
    // ChanDir is whether a channel can send, receive, or both.
    type ChanDir uint8
    
    func (c ChanDir) CanRecv() bool { return c&Crecv != 0 }
    func (c ChanDir) CanSend() bool { return c&Csend != 0 }
    
    const (
    	// types of channel
    	// must match ../../../../reflect/type.go:/ChanDir
    	Crecv ChanDir = 1 << 0
    	Csend ChanDir = 1 << 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
Back to top