Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for isNonTypeParamInterface (0.33 sec)

  1. src/go/types/assignments.go

    				if T == nil {
    					check.errorf(x, UntypedNilUse, "use of untyped nil in %s", context)
    					x.mode = invalid
    					return
    				}
    			} else if T == nil || isNonTypeParamInterface(T) {
    				target = Default(x.typ)
    			}
    		} else { // go/types
    			if T == nil || isNonTypeParamInterface(T) {
    				if T == nil && x.typ == Typ[UntypedNil] {
    					check.errorf(x, UntypedNilUse, "use of untyped nil in %s", context)
    					x.mode = invalid
    					return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/predicates.go

    }
    
    // IsInterface reports whether t is an interface type.
    func IsInterface(t Type) bool {
    	_, ok := under(t).(*Interface)
    	return ok
    }
    
    // isNonTypeParamInterface reports whether t is an interface type but not a type parameter.
    func isNonTypeParamInterface(t Type) bool {
    	return !isTypeParam(t) && IsInterface(t)
    }
    
    // isTypeParam reports whether t is a type parameter.
    func isTypeParam(t Type) bool {
    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/assignments.go

    				if T == nil {
    					check.errorf(x, UntypedNilUse, "use of untyped nil in %s", context)
    					x.mode = invalid
    					return
    				}
    			} else if T == nil || isNonTypeParamInterface(T) {
    				target = Default(x.typ)
    			}
    		} else { // go/types
    			if T == nil || isNonTypeParamInterface(T) {
    				if T == nil && x.typ == Typ[UntypedNil] {
    					check.errorf(x, UntypedNilUse, "use of untyped nil in %s", context)
    					x.mode = invalid
    					return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  4. src/go/types/predicates.go

    }
    
    // IsInterface reports whether t is an interface type.
    func IsInterface(t Type) bool {
    	_, ok := under(t).(*Interface)
    	return ok
    }
    
    // isNonTypeParamInterface reports whether t is an interface type but not a type parameter.
    func isNonTypeParamInterface(t Type) bool {
    	return !isTypeParam(t) && IsInterface(t)
    }
    
    // isTypeParam reports whether t is a type parameter.
    func isTypeParam(t Type) bool {
    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/go/types/conversions.go

    		// - For constant integer to string conversions, keep the argument type.
    		//   (See also the TODO below.)
    		if isTypes2 && x.typ == Typ[UntypedNil] {
    			// ok
    		} else if isNonTypeParamInterface(T) || constArg && !isConstType(T) || !isTypes2 && x.isNil() {
    			final = Default(x.typ) // default type of untyped nil is untyped nil
    		} else if x.mode == constant_ && isInteger(x.typ) && allString(T) {
    			final = x.typ
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:51:00 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/conversions.go

    		// - For constant integer to string conversions, keep the argument type.
    		//   (See also the TODO below.)
    		if isTypes2 && x.typ == Typ[UntypedNil] {
    			// ok
    		} else if isNonTypeParamInterface(T) || constArg && !isConstType(T) || !isTypes2 && x.isNil() {
    			final = Default(x.typ) // default type of untyped nil is untyped nil
    		} else if x.mode == constant_ && isInteger(x.typ) && allString(T) {
    			final = x.typ
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:51:00 UTC 2024
    - 9K bytes
    - Viewed (0)
  7. src/go/types/expr.go

    		//           valid with interfaces), but in that case the assignability check should take
    		//           care of the conversion. Verify and possibly eliminate this extra test.
    		if isNonTypeParamInterface(x.typ) || isNonTypeParamInterface(y.typ) {
    			return true
    		}
    		// A boolean type can only convert to another boolean type.
    		if allBoolean(x.typ) != allBoolean(y.typ) {
    			return false
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/expr.go

    		//           valid with interfaces), but in that case the assignability check should take
    		//           care of the conversion. Verify and possibly eliminate this extra test.
    		if isNonTypeParamInterface(x.typ) || isNonTypeParamInterface(y.typ) {
    			return true
    		}
    		// A boolean type can only convert to another boolean type.
    		if allBoolean(x.typ) != allBoolean(y.typ) {
    			return false
    		}
    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