Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for NewTypeParam (0.29 sec)

  1. src/go/types/context_test.go

    	// unaryP has a parameter.
    	var nullaryP, nullaryQ, unaryP Type
    	{
    		// type nullaryP = func[P any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "P", nil), &emptyInterface)
    		nullaryP = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    		// type nullaryQ = func[Q any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "Q", nil), &emptyInterface)
    		nullaryQ = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  2. src/go/types/typeparam.go

    }
    
    // NewTypeParam returns a new TypeParam. Type parameters may be set on a Named
    // or Signature type by calling SetTypeParams. Setting a type parameter on more
    // than one type will result in a panic.
    //
    // The constraint argument can be nil, and set later via SetConstraint. If the
    // constraint is non-nil, it must be fully defined.
    func NewTypeParam(obj *TypeName, constraint Type) *TypeParam {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 20:03:31 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/typeparam.go

    }
    
    // NewTypeParam returns a new TypeParam. Type parameters may be set on a Named
    // or Signature type by calling SetTypeParams. Setting a type parameter on more
    // than one type will result in a panic.
    //
    // The constraint argument can be nil, and set later via SetConstraint. If the
    // constraint is non-nil, it must be fully defined.
    func NewTypeParam(obj *TypeName, constraint Type) *TypeParam {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 20:03:31 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/context_test.go

    	// unaryP has a parameter.
    	var nullaryP, nullaryQ, unaryP Type
    	{
    		// type nullaryP = func[P any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "P", nil), &emptyInterface)
    		nullaryP = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    	}
    	{
    		// type nullaryQ = func[Q any]()
    		tparam := NewTypeParam(NewTypeName(nopos, nil, "Q", nil), &emptyInterface)
    		nullaryQ = NewSignatureType(nil, nil, []*TypeParam{tparam}, nil, nil, false)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 17 04:32:02 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/object_test.go

    		}
    	}
    
    	// various other types
    	pkg := NewPackage("p", "p")
    	t1 := NewTypeName(nopos, pkg, "t1", nil)
    	n1 := NewNamed(t1, new(Struct), nil)
    	t5 := NewTypeName(nopos, pkg, "t5", nil)
    	NewTypeParam(t5, nil)
    	for _, test := range []struct {
    		name  *TypeName
    		alias bool
    	}{
    		{NewTypeName(nopos, nil, "t0", nil), false}, // no type yet
    		{NewTypeName(nopos, pkg, "t0", nil), false}, // no type yet
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  6. src/go/types/object_test.go

    		}
    	}
    
    	// various other types
    	pkg := NewPackage("p", "p")
    	t1 := NewTypeName(nopos, pkg, "t1", nil)
    	n1 := NewNamed(t1, new(Struct), nil)
    	t5 := NewTypeName(nopos, pkg, "t5", nil)
    	NewTypeParam(t5, nil)
    	for _, test := range []struct {
    		name  *TypeName
    		alias bool
    	}{
    		{NewTypeName(nopos, nil, "t0", nil), false}, // no type yet
    		{NewTypeName(nopos, pkg, "t0", nil), false}, // no type yet
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/issues_test.go

    	// P where P's core type is string
    	{
    		P := NewTypeName(nopos, nil, "P", nil) // [P string]
    		makeSig(NewTypeParam(P, NewInterfaceType(nil, []Type{Typ[String]})))
    	}
    
    	// P where P's core type is an (unnamed) slice
    	{
    		P := NewTypeName(nopos, nil, "P", nil) // [P []int]
    		makeSig(NewTypeParam(P, NewInterfaceType(nil, []Type{NewSlice(Typ[Int])})))
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  8. src/go/types/issues_test.go

    	// P where P's core type is string
    	{
    		P := NewTypeName(nopos, nil, "P", nil) // [P string]
    		makeSig(NewTypeParam(P, NewInterfaceType(nil, []Type{Typ[String]})))
    	}
    
    	// P where P's core type is an (unnamed) slice
    	{
    		P := NewTypeName(nopos, nil, "P", nil) // [P []int]
    		makeSig(NewTypeParam(P, NewInterfaceType(nil, []Type{NewSlice(Typ[Int])})))
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  9. api/go1.18.txt

    pkg go/types, func NewSignature //deprecated
    pkg go/types, func NewSignatureType(*Var, []*TypeParam, []*TypeParam, *Tuple, *Tuple, bool) *Signature
    pkg go/types, func NewTerm(bool, Type) *Term
    pkg go/types, func NewTypeParam(*TypeName, Type) *TypeParam
    pkg go/types, func NewUnion([]*Term) *Union
    pkg go/types, method (*ArgumentError) Error() string
    pkg go/types, method (*ArgumentError) Unwrap() error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 20:31:46 UTC 2023
    - 13K bytes
    - Viewed (0)
  10. src/go/internal/gcimporter/ureader.go

    	for i := range r.dict.bounds {
    		pos := r.pos()
    		pkg, name := r.localIdent()
    
    		tname := types.NewTypeName(pos, pkg, name, nil)
    		r.dict.tparams[i] = types.NewTypeParam(tname, nil)
    	}
    
    	typs := make([]types.Type, len(r.dict.bounds))
    	for i, bound := range r.dict.bounds {
    		typs[i] = r.p.typIdx(bound, r.dict)
    	}
    
    	// TODO(mdempsky): This is subtle, elaborate further.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.6K bytes
    - Viewed (0)
Back to top