Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for isTyped (0.32 sec)

  1. src/go/types/predicates.go

    func isTypeLit(t Type) bool {
    	switch Unalias(t).(type) {
    	case *Named, *TypeParam:
    		return false
    	}
    	return true
    }
    
    // isTyped reports whether t is typed; i.e., not an untyped
    // constant or boolean.
    // Safe to call from types that are not fully set up.
    func isTyped(t Type) bool {
    	// Alias and named types cannot denote untyped types
    	// so there's no need to call Unalias or under, below.
    	b, _ := t.(*Basic)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/predicates.go

    func isTypeLit(t Type) bool {
    	switch Unalias(t).(type) {
    	case *Named, *TypeParam:
    		return false
    	}
    	return true
    }
    
    // isTyped reports whether t is typed; i.e., not an untyped
    // constant or boolean.
    // Safe to call from types that are not fully set up.
    func isTyped(t Type) bool {
    	// Alias and named types cannot denote untyped types
    	// so there's no need to call Unalias or under, below.
    	b, _ := t.(*Basic)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/check.go

    func (check *Checker) recordCommaOkTypes(x syntax.Expr, a []*operand) {
    	assert(x != nil)
    	assert(len(a) == 2)
    	if a[0].mode == invalid {
    		return
    	}
    	t0, t1 := a[0].typ, a[1].typ
    	assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
    	if m := check.Types; m != nil {
    		for {
    			tv := m[x]
    			assert(tv.Type != nil) // should have been recorded already
    			pos := x.Pos()
    			tv.Type = NewTuple(
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K bytes
    - Viewed (0)
  4. src/go/types/check.go

    func (check *Checker) recordCommaOkTypes(x ast.Expr, a []*operand) {
    	assert(x != nil)
    	assert(len(a) == 2)
    	if a[0].mode == invalid {
    		return
    	}
    	t0, t1 := a[0].typ, a[1].typ
    	assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
    	if m := check.Types; m != nil {
    		for {
    			tv := m[x]
    			assert(tv.Type != nil) // should have been recorded already
    			pos := x.Pos()
    			tv.Type = NewTuple(
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/typexpr.go

    // before any components of e are type-checked.
    func (check *Checker) definedType(e syntax.Expr, def *TypeName) Type {
    	typ := check.typInternal(e, def)
    	assert(isTyped(typ))
    	if isGeneric(typ) {
    		check.errorf(e, WrongTypeArgCount, "cannot use generic type %s without instantiation", typ)
    		typ = Typ[Invalid]
    	}
    	check.recordTypeAndValue(e, typexpr, typ, nil)
    	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)
  6. src/go/types/typexpr.go

    // before any components of e are type-checked.
    func (check *Checker) definedType(e ast.Expr, def *TypeName) Type {
    	typ := check.typInternal(e, def)
    	assert(isTyped(typ))
    	if isGeneric(typ) {
    		check.errorf(e, WrongTypeArgCount, "cannot use generic type %s without instantiation", typ)
    		typ = Typ[Invalid]
    	}
    	check.recordTypeAndValue(e, typexpr, typ, nil)
    	return typ
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/infer.go

    		if isParameterized(tparams, par.typ) || isParameterized(tparams, arg.typ) {
    			// Function parameters are always typed. Arguments may be untyped.
    			// Collect the indices of untyped arguments and handle them later.
    			if isTyped(arg.typ) {
    				if !u.unify(par.typ, arg.typ, assign) {
    					errorf(par.typ, arg.typ, arg)
    					return nil
    				}
    			} else if _, ok := par.typ.(*TypeParam); ok && !arg.isNil() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  8. src/go/types/infer.go

    		if isParameterized(tparams, par.typ) || isParameterized(tparams, arg.typ) {
    			// Function parameters are always typed. Arguments may be untyped.
    			// Collect the indices of untyped arguments and handle them later.
    			if isTyped(arg.typ) {
    				if !u.unify(par.typ, arg.typ, assign) {
    					errorf(par.typ, arg.typ, arg)
    					return nil
    				}
    			} else if _, ok := par.typ.(*TypeParam); ok && !arg.isNil() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  9. src/go/types/expr.go

    	// not compatible, we report a type mismatch error.
    	mayConvert := func(x, y *operand) bool {
    		// If both operands are typed, there's no need for an implicit conversion.
    		if isTyped(x.typ) && isTyped(y.typ) {
    			return false
    		}
    		// An untyped operand may convert to its default type when paired with an empty interface
    		// TODO(gri) This should only matter for comparisons (the only binary operation that is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/expr.go

    	// not compatible, we report a type mismatch error.
    	mayConvert := func(x, y *operand) bool {
    		// If both operands are typed, there's no need for an implicit conversion.
    		if isTyped(x.typ) && isTyped(y.typ) {
    			return false
    		}
    		// An untyped operand may convert to its default type when paired with an empty interface
    		// TODO(gri) This should only matter for comparisons (the only binary operation that is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
Back to top