mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
Add test for aliases with type params, added in go 1.24
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module codeql-go-types
|
||||
|
||||
go 1.23
|
||||
go 1.24
|
||||
|
||||
Reference in New Issue
Block a user