- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for NewTypeParam (0.24 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
src/go/internal/gcimporter/iimport.go
// Remove the "path" from the type param name that makes it unique, // and revert any unique name used for blank typeparams. name0 := tparamName(name) tn := types.NewTypeName(pos, r.currPkg, name0, nil) t := types.NewTypeParam(tn, nil) // To handle recursive references to the typeparam within its // bound, save the partial type in tparamIndex before reading the bounds. id := ident{r.currPkg, name} r.p.tparamIndex[id] = t
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 19.2K bytes - Viewed (0) -
src/go/types/infer.go
} tparams2 := make([]*TypeParam, len(tparams)) for i, tparam := range tparams { tname := NewTypeName(tparam.Obj().Pos(), tparam.Obj().Pkg(), tparam.Obj().Name(), nil) tparams2[i] = NewTypeParam(tname, nil) tparams2[i].index = tparam.index // == i } renameMap := makeRenameMap(tparams, tparams2) for i, tparam := range tparams {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 13:54:20 UTC 2024 - 26.5K bytes - Viewed (0)