Add test for aliases with type params, added in go 1.24

This commit is contained in:
Owen Mansel-Chan
2025-01-09 16:00:41 +00:00
parent e3d6480c22
commit d97cda7582
2 changed files with 12 additions and 1 deletions

View File

@@ -25,3 +25,14 @@ type T = S3
func H(Afs3 T) int {
return Afs3.x
}
type MyType[MyTypeT any] struct{ x MyTypeT }
// An alias with a type parameter - added in Go 1.24
type MyTypeAlias[MyTypeAliasT any] = MyType[MyTypeAliasT]
func useMyTypeAlias(a MyTypeAlias[string]) string {
b := MyTypeAlias[string]{x: "hello"}
a.x = b.x
return a.x
}

View File

@@ -1,3 +1,3 @@
module codeql-go-types
go 1.23
go 1.24