Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for ChanDir (0.32 sec)

  1. src/reflect/type.go

    		i--
    	}
    	return s[i+1:]
    }
    
    func nameFor(t *abi.Type) string {
    	return toRType(t).Name()
    }
    
    func (t *rtype) ChanDir() ChanDir {
    	if t.Kind() != Chan {
    		panic("reflect: ChanDir of non-chan type " + t.String())
    	}
    	tt := (*abi.ChanType)(unsafe.Pointer(t))
    	return ChanDir(tt.Dir)
    }
    
    func toRType(t *abi.Type) *rtype {
    	return (*rtype)(unsafe.Pointer(t))
    }
    
    func elem(t *abi.Type) *abi.Type {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  2. src/internal/reflectlite/type.go

    		// x is a bidirectional channel value, T is a channel type,
    		// and x's type V and T have identical element types.
    		if V.ChanDir() == abi.BothDir && haveIdenticalType(T.Elem(), V.Elem(), cmpTags) {
    			return true
    		}
    
    		// Otherwise continue test for identical underlying type.
    		return V.ChanDir() == T.ChanDir() && haveIdenticalType(T.Elem(), V.Elem(), cmpTags)
    
    	case abi.Func:
    		t := (*funcType)(unsafe.Pointer(T))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types/fmt.go

    	case TCHAN:
    		switch t.ChanDir() {
    		case Crecv:
    			b.WriteString("<-chan ")
    			tconv2(b, t.Elem(), 0, mode, visited)
    		case Csend:
    			b.WriteString("chan<- ")
    			tconv2(b, t.Elem(), 0, mode, visited)
    		default:
    			b.WriteString("chan ")
    			if t.Elem() != nil && t.Elem().IsChan() && t.Elem().Sym() == nil && t.Elem().ChanDir() == Crecv {
    				b.WriteByte('(')
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  4. api/go1.5.txt

    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
    pkg go/types, const SendRecv ChanDir
    pkg go/types, const String = 17
    pkg go/types, const String BasicKind
    pkg go/types, const Uint = 7
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 30 21:14:09 UTC 2015
    - 46.6K bytes
    - Viewed (0)
  5. src/go/ast/ast.go

    		Colon token.Pos // position of ":"
    		Value Expr
    	}
    )
    
    // The direction of a channel type is indicated by a bit
    // mask including one or both of the following constants.
    type ChanDir int
    
    const (
    	SEND ChanDir = 1 << iota
    	RECV
    )
    
    // A type is represented by a tree consisting of one
    // or more of the following type-specific expression
    // nodes.
    type (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go

    		value := TypeExpr(f, pkg, t.Elem())
    		if key == nil || value == nil {
    			return nil
    		}
    		return &ast.MapType{
    			Key:   key,
    			Value: value,
    		}
    	case *types.Chan:
    		dir := ast.ChanDir(t.Dir())
    		if t.Dir() == types.SendRecv {
    			dir = ast.SEND | ast.RECV
    		}
    		value := TypeExpr(f, pkg, t.Elem())
    		if value == nil {
    			return nil
    		}
    		return &ast.ChanType{
    			Dir:   dir,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/typecheck/stmt.go

    	n.Chan = DefaultLit(n.Chan, nil)
    	t := n.Chan.Type()
    	if t == nil {
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (send to non-chan type %v)", n, t)
    		return n
    	}
    
    	if !t.ChanDir().CanSend() {
    		base.Errorf("invalid operation: %v (send to receive-only type %v)", n, t)
    		return n
    	}
    
    	n.Value = AssignConv(n.Value, t.Elem(), "send")
    	if n.Value.Type() == nil {
    		return n
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:10:54 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  8. src/go/internal/gcimporter/iimport.go

    		return types.NewPointer(r.typ())
    	case sliceType:
    		return types.NewSlice(r.typ())
    	case arrayType:
    		n := r.uint64()
    		return types.NewArray(r.typ(), int64(n))
    	case chanType:
    		dir := chanDir(int(r.uint64()))
    		return types.NewChan(dir, r.typ())
    	case mapType:
    		return types.NewMap(r.typ(), r.typ())
    	case signatureType:
    		r.currPkg = r.pkg()
    		return r.signature(nil, nil, nil)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  9. src/go/internal/gcimporter/ureader.go

    	case pkgbits.TypeTypeParam:
    		return r.dict.tparams[r.Len()]
    
    	case pkgbits.TypeArray:
    		len := int64(r.Uint64())
    		return types.NewArray(r.typ(), len)
    	case pkgbits.TypeChan:
    		dir := types.ChanDir(r.Len())
    		return types.NewChan(dir, r.typ())
    	case pkgbits.TypeMap:
    		return types.NewMap(r.typ(), r.typ())
    	case pkgbits.TypePointer:
    		return types.NewPointer(r.typ())
    	case pkgbits.TypeSignature:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  10. src/reflect/value.go

    // It panics if v's Kind is not [Chan] or
    // v is a receive-only channel.
    func (v Value) Close() {
    	v.mustBe(Chan)
    	v.mustBeExported()
    	tt := (*chanType)(unsafe.Pointer(v.typ()))
    	if ChanDir(tt.Dir)&SendDir == 0 {
    		panic("reflect: close of receive-only channel")
    	}
    
    	chanclose(v.pointer())
    }
    
    // CanComplex reports whether [Value.Complex] can be used without panicking.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
Back to top