You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/scripts/typeparams.txt

47 lines
898 B
Plaintext

env GOGARBLE=*
garble build
! binsubstr main$exe ${WORK} 'garble_main.go' 'GenericFunc' 'GenericVector' 'PredeclaredSignedInteger' 'StringableSignedInteger' 'CombineEmbeds' 'GenericParam'
-- go.mod --
module test/main
go 1.18
-- garble_main.go --
package main
func main() {
GenericFunc[int, int](1, 2)
var _ GenericVector[int]
g := GenericGraph[string]{Content: "Foo"}
g.Edges = make([]GenericGraph[string], 1)
}
func GenericFunc[GenericParamA, B any](x GenericParamA, y B) {}
type GenericVector[GenericParamT any] []GenericParamT
type GenericGraph[T any] struct {
Content T
Edges []GenericGraph[T]
}
type PredeclaredSignedInteger interface {
int | int8 | int16 | int32 | int64
}
type StringableSignedInteger interface {
~int | ~int8 | ~int16 | ~int32 | ~int64
String() string
}
type CombineEmbeds interface {
string | int
interface { EmbeddedMethod() }
RegularMethod()
}