Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for RecvOnly (0.24 sec)

  1. src/go/types/typestring.go

    		var parens bool
    		switch t.dir {
    		case SendRecv:
    			s = "chan "
    			// chan (<-chan T) requires parentheses
    			if c, _ := t.elem.(*Chan); c != nil && c.dir == RecvOnly {
    				parens = true
    			}
    		case SendOnly:
    			s = "chan<- "
    		case RecvOnly:
    			s = "<-chan "
    		default:
    			w.error("unknown channel direction")
    		}
    		w.string(s)
    		if parens {
    			w.byte('(')
    		}
    		w.typ(t.elem)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/typestring.go

    		var parens bool
    		switch t.dir {
    		case SendRecv:
    			s = "chan "
    			// chan (<-chan T) requires parentheses
    			if c, _ := t.elem.(*Chan); c != nil && c.dir == RecvOnly {
    				parens = true
    			}
    		case SendOnly:
    			s = "chan<- "
    		case RecvOnly:
    			s = "<-chan "
    		default:
    			w.error("unknown channel direction")
    		}
    		w.string(s)
    		if parens {
    			w.byte('(')
    		}
    		w.typ(t.elem)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/typexpr.go

    		typ := new(Chan)
    		setDefType(def, typ)
    
    		dir := SendRecv
    		switch e.Dir {
    		case 0:
    			// nothing to do
    		case syntax.SendOnly:
    			dir = SendOnly
    		case syntax.RecvOnly:
    			dir = RecvOnly
    		default:
    			check.errorf(e, InvalidSyntaxTree, "unknown channel direction %d", e.Dir)
    			// ok to continue
    		}
    
    		typ.dir = dir
    		typ.elem = check.varType(e.Elem)
    		return typ
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/printer.go

    	case *MapType:
    		p.print(_Map, _Lbrack, n.Key, _Rbrack, n.Value)
    
    	case *ChanType:
    		if n.Dir == RecvOnly {
    			p.print(_Arrow)
    		}
    		p.print(_Chan)
    		if n.Dir == SendOnly {
    			p.print(_Arrow)
    		}
    		p.print(blank)
    		if e, _ := n.Elem.(*ChanType); n.Dir == 0 && e != nil && e.Dir == RecvOnly {
    			// don't print chan (<-chan T) as chan <-chan T
    			p.print(_Lparen)
    			p.print(n.Elem)
    			p.print(_Rparen)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  5. src/go/types/typexpr.go

    		typ := new(Chan)
    		setDefType(def, typ)
    
    		dir := SendRecv
    		switch e.Dir {
    		case ast.SEND | ast.RECV:
    			// nothing to do
    		case ast.SEND:
    			dir = SendOnly
    		case ast.RECV:
    			dir = RecvOnly
    		default:
    			check.errorf(e, InvalidSyntaxTree, "unknown channel direction %d", e.Dir)
    			// ok to continue
    		}
    
    		typ.dir = dir
    		typ.elem = check.varType(e.Value)
    		return typ
    
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  6. api/go1.5.txt

    pkg go/types, const MethodExpr = 2
    pkg go/types, const MethodExpr SelectionKind
    pkg go/types, const MethodVal = 1
    pkg go/types, const MethodVal SelectionKind
    pkg go/types, const RecvOnly = 2
    pkg go/types, const RecvOnly ChanDir
    pkg go/types, const Rune = 5
    pkg go/types, const Rune BasicKind
    pkg go/types, const SendOnly = 1
    pkg go/types, const SendOnly ChanDir
    pkg go/types, const SendRecv = 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 30 21:14:09 UTC 2015
    - 46.6K bytes
    - Viewed (0)
  7. src/go/types/builtins.go

    		if !underIs(x.typ, func(u Type) bool {
    			uch, _ := u.(*Chan)
    			if uch == nil {
    				check.errorf(x, InvalidClose, invalidOp+"cannot close non-channel %s", x)
    				return false
    			}
    			if uch.dir == RecvOnly {
    				check.errorf(x, InvalidClose, invalidOp+"cannot close receive-only channel %s", x)
    				return false
    			}
    			return true
    		}) {
    			return
    		}
    		x.mode = novalue
    		if check.recordTypes() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  8. src/go/types/stmt.go

    			return
    		}
    		uch, _ := u.(*Chan)
    		if uch == nil {
    			check.errorf(inNode(s, s.Arrow), InvalidSend, invalidOp+"cannot send to non-channel %s", &ch)
    			return
    		}
    		if uch.dir == RecvOnly {
    			check.errorf(inNode(s, s.Arrow), InvalidSend, invalidOp+"cannot send to receive-only channel %s", &ch)
    			return
    		}
    		check.assignment(&val, uch.elem, "send")
    
    	case *ast.IncDecStmt:
    		var op token.Token
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  9. src/go/internal/gccgoimporter/parser.go

    	case '-':
    		p.next()
    		p.expect('<')
    		dir = types.SendOnly
    
    	case '<':
    		// don't consume '<' if it belongs to Type
    		if p.scanner.Peek() == '-' {
    			p.next()
    			p.expect('-')
    			dir = types.RecvOnly
    		}
    	}
    
    	*t = *types.NewChan(dir, p.parseType(pkg))
    	return t
    }
    
    // StructType = "struct" "{" { Field } "}" .
    func (p *parser) parseStructType(pkg *types.Package, nlist []any) types.Type {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/builtins.go

    		if !underIs(x.typ, func(u Type) bool {
    			uch, _ := u.(*Chan)
    			if uch == nil {
    				check.errorf(x, InvalidClose, invalidOp+"cannot close non-channel %s", x)
    				return false
    			}
    			if uch.dir == RecvOnly {
    				check.errorf(x, InvalidClose, invalidOp+"cannot close receive-only channel %s", x)
    				return false
    			}
    			return true
    		}) {
    			return
    		}
    		x.mode = novalue
    		if check.recordTypes() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
Back to top