Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for isGeneric (0.14 sec)

  1. 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)
  2. 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)
  3. src/cmd/compile/internal/types2/predicates.go

    		return iface != nil && iface.tset != nil && iface.tset.IsEmpty()
    	}
    	return false
    }
    
    // isGeneric reports whether a type is a generic, uninstantiated type
    // (generic signatures are not included).
    // TODO(gri) should we include signatures or assert that they are not present?
    func isGeneric(t Type) bool {
    	// A parameterized type is only generic if it doesn't have an instantiation already.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  4. src/go/types/predicates.go

    		return iface != nil && iface.tset != nil && iface.tset.IsEmpty()
    	}
    	return false
    }
    
    // isGeneric reports whether a type is a generic, uninstantiated type
    // (generic signatures are not included).
    // TODO(gri) should we include signatures or assert that they are not present?
    func isGeneric(t Type) bool {
    	// A parameterized type is only generic if it doesn't have an instantiation already.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/operand.go

    	if x.mode == constant_ {
    		if s := x.val.String(); s != expr {
    			buf.WriteByte(' ')
    			buf.WriteString(s)
    		}
    	}
    
    	// <typ>
    	if hasType {
    		if isValid(x.typ) {
    			var intro string
    			if isGeneric(x.typ) {
    				intro = " of generic type "
    			} else {
    				intro = " of type "
    			}
    			buf.WriteString(intro)
    			WriteType(&buf, x.typ, qf)
    			if tpar, _ := Unalias(x.typ).(*TypeParam); tpar != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11K bytes
    - Viewed (0)
  6. src/go/types/operand.go

    	if x.mode == constant_ {
    		if s := x.val.String(); s != expr {
    			buf.WriteByte(' ')
    			buf.WriteString(s)
    		}
    	}
    
    	// <typ>
    	if hasType {
    		if isValid(x.typ) {
    			var intro string
    			if isGeneric(x.typ) {
    				intro = " of generic type "
    			} else {
    				intro = " of type "
    			}
    			buf.WriteString(intro)
    			WriteType(&buf, x.typ, qf)
    			if tpar, _ := Unalias(x.typ).(*TypeParam); tpar != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 21:17:10 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/decl.go

    		case *TypeName:
    			// If we reach a generic type that is part of a cycle
    			// and we are in a type parameter list, we have a cycle
    			// through a type parameter list, which is invalid.
    			if check.inTParamList && isGeneric(obj.typ) {
    				tparCycle = true
    				break loop
    			}
    
    			// Determine if the type name is an alias or not. For
    			// package-level objects, use the object map which
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  8. src/go/types/decl.go

    		case *TypeName:
    			// If we reach a generic type that is part of a cycle
    			// and we are in a type parameter list, we have a cycle
    			// through a type parameter list, which is invalid.
    			if check.inTParamList && isGeneric(obj.typ) {
    				tparCycle = true
    				break loop
    			}
    
    			// Determine if the type name is an alias or not. For
    			// package-level objects, use the object map which
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  9. src/go/types/expr.go

    func (check *Checker) nonGeneric(T *target, x *operand) {
    	if x.mode == invalid || x.mode == novalue {
    		return
    	}
    	var what string
    	switch t := x.typ.(type) {
    	case *Alias, *Named:
    		if isGeneric(t) {
    			what = "type"
    		}
    	case *Signature:
    		if t.tparams != nil {
    			if enableReverseTypeInference && T != nil {
    				check.funcInst(T, x.Pos(), x, nil, true)
    				return
    			}
    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

    func (check *Checker) nonGeneric(T *target, x *operand) {
    	if x.mode == invalid || x.mode == novalue {
    		return
    	}
    	var what string
    	switch t := x.typ.(type) {
    	case *Alias, *Named:
    		if isGeneric(t) {
    			what = "type"
    		}
    	case *Signature:
    		if t.tparams != nil {
    			if enableReverseTypeInference && T != nil {
    				check.funcInst(T, x.Pos(), x, nil, true)
    				return
    			}
    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