Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 30 for ChanType (0.25 sec)

  1. src/runtime/chan.go

    }
    
    //go:linkname reflect_makechan reflect.makechan
    func reflect_makechan(t *chantype, size int) *hchan {
    	return makechan(t, size)
    }
    
    func makechan64(t *chantype, size int64) *hchan {
    	if int64(int(size)) != size {
    		panic(plainError("makechan: size out of range"))
    	}
    
    	return makechan(t, int(size))
    }
    
    func makechan(t *chantype, size int) *hchan {
    	elem := t.Elem
    
    	// compiler checks this but be safe.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:50 UTC 2024
    - 25.9K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/parser.go

    		// the channel type parsed already:
    		//
    		//   <-(chan E)   =>  (<-chan E)
    		//   <-(chan<-E)  =>  (<-chan (<-E))
    
    		if _, ok := x.(*ChanType); ok {
    			// x is a channel type => re-associate <-
    			dir := SendOnly
    			t := x
    			for dir == SendOnly {
    				c, ok := t.(*ChanType)
    				if !ok {
    					break
    				}
    				dir = c.Dir
    				if dir == RecvOnly {
    					// t is type <-chan E but <-<-chan E is not permitted
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go

    		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,
    			Value: value,
    		}
    	case *types.Signature:
    		var params []*ast.Field
    		for i := 0; i < t.Params().Len(); i++ {
    			p := TypeExpr(f, pkg, t.Params().At(i).Type())
    			if p == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  4. src/go/ast/filter.go

    			t.Incomplete = true
    		}
    		return len(t.Methods.List) > 0
    	case *MapType:
    		b1 := filterType(t.Key, f, export)
    		b2 := filterType(t.Value, f, export)
    		return b1 || b2
    	case *ChanType:
    		return filterType(t.Value, f, export)
    	}
    	return false
    }
    
    func filterSpec(spec Spec, f Filter, export bool) bool {
    	switch s := spec.(type) {
    	case *ValueSpec:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. src/reflect/type.go

    	BothDir = RecvDir | SendDir             // chan
    )
    
    // arrayType represents a fixed array type.
    type arrayType = abi.ArrayType
    
    // chanType represents a channel type.
    type chanType = abi.ChanType
    
    // funcType represents a function type.
    //
    // A *rtype for each in and out parameter is stored in an array that
    // directly follows the funcType (and possibly its uncommonType). So
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  6. src/go/internal/gccgoimporter/parser.go

    	t := new(types.Map)
    	p.update(t, nlist)
    
    	p.expect('[')
    	key := p.parseType(pkg)
    	p.expect(']')
    	elem := p.parseType(pkg)
    
    	*t = *types.NewMap(key, elem)
    	return t
    }
    
    // ChanType = "chan" ["<-" | "-<"] Type .
    func (p *parser) parseChanType(pkg *types.Package, nlist []any) types.Type {
    	p.expectKeyword("chan")
    
    	t := new(types.Chan)
    	p.update(t, nlist)
    
    	dir := types.SendRecv
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types/type.go

    }
    
    // Chan contains Type fields specific to channel types.
    type Chan struct {
    	Elem *Type   // element type
    	Dir  ChanDir // channel direction
    }
    
    // chanType returns t's extra channel-specific fields.
    func (t *Type) chanType() *Chan {
    	t.wantEtype(TCHAN)
    	return t.extra.(*Chan)
    }
    
    type Tuple struct {
    	first  *Type
    	second *Type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  8. src/cmd/link/internal/ld/deadcode.go

    		off += arch.PtrSize // 4 bytes, pointer aligned
    	case abi.Slice: // reflect.sliceType
    		off += arch.PtrSize
    	case abi.Array: // reflect.arrayType
    		off += 3 * arch.PtrSize
    	case abi.Chan: // reflect.chanType
    		off += 2 * arch.PtrSize
    	case abi.Map: // reflect.mapType
    		off += 4*arch.PtrSize + 8
    	case abi.Interface: // reflect.interfaceType
    		off += 3 * arch.PtrSize
    	default:
    		// just Sizeof(rtype)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 14:52:41 UTC 2024
    - 19K bytes
    - Viewed (0)
  9. src/go/types/typexpr.go

    				}
    				check.errorf(e.Key, IncomparableMapKey, "invalid map key type %s%s", typ.key, why)
    			}
    		}).describef(e.Key, "check map key %s", typ.key)
    
    		return typ
    
    	case *ast.ChanType:
    		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:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/typexpr.go

    				}
    				check.errorf(e.Key, IncomparableMapKey, "invalid map key type %s%s", typ.key, why)
    			}
    		}).describef(e.Key, "check map key %s", typ.key)
    
    		return typ
    
    	case *syntax.ChanType:
    		typ := new(Chan)
    		setDefType(def, typ)
    
    		dir := SendRecv
    		switch e.Dir {
    		case 0:
    			// nothing to do
    		case syntax.SendOnly:
    			dir = SendOnly
    		case syntax.RecvOnly:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
Back to top