Skip to content

Commit cb0658e

Browse files
committed
go/types: expose more API under -tags=typeparams
Updates #44933. Change-Id: I0c4c2a54f67b47771f4fa59f11c47fa7b0dde799 Reviewed-on: https://go-review.googlesource.com/c/go/+/317029 Trust: Matthew Dempsky <[email protected]> Trust: Robert Griesemer <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 62a87f6 commit cb0658e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/go/types/api_typeparams.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import (
1111
"go/ast"
1212
)
1313

14-
type Inferred = _Inferred
14+
type (
15+
Inferred = _Inferred
16+
Sum = _Sum
17+
TypeParam = _TypeParam
18+
)
1519

1620
func GetInferred(info *Info) map[ast.Expr]Inferred {
1721
return info._Inferred
@@ -20,3 +24,16 @@ func GetInferred(info *Info) map[ast.Expr]Inferred {
2024
func SetInferred(info *Info, inferred map[ast.Expr]Inferred) {
2125
info._Inferred = inferred
2226
}
27+
28+
func NewSum(types []Type) Type { return _NewSum(types) }
29+
30+
func (s *Signature) TParams() []*TypeName { return s._TParams() }
31+
func (s *Signature) SetTParams(tparams []*TypeName) { s._SetTParams(tparams) }
32+
33+
func (t *Interface) HasTypeList() bool { return t._HasTypeList() }
34+
func (t *Interface) IsComparable() bool { return t._IsComparable() }
35+
func (t *Interface) IsConstraint() bool { return t._IsConstraint() }
36+
37+
func (t *Named) TParams() []*TypeName { return t._TParams() }
38+
func (t *Named) TArgs() []Type { return t._TArgs() }
39+
func (t *Named) SetTArgs(args []Type) { t._SetTArgs(args) }

0 commit comments

Comments
 (0)