Initial commit: Go 1.23 release state
This commit is contained in:
30
test/typeparam/issue50481c.dir/a.go
Normal file
30
test/typeparam/issue50481c.dir/a.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package a
|
||||
|
||||
type A interface {
|
||||
int | int64
|
||||
}
|
||||
|
||||
type B interface {
|
||||
string
|
||||
}
|
||||
|
||||
type C interface {
|
||||
String() string
|
||||
}
|
||||
|
||||
type Myint int
|
||||
|
||||
func (i Myint) String() string {
|
||||
return "aa"
|
||||
}
|
||||
|
||||
type T[P A, _ C, _ B] int
|
||||
|
||||
func (v T[P, Q, R]) test() {
|
||||
var r Q
|
||||
r.String()
|
||||
}
|
||||
18
test/typeparam/issue50481c.dir/main.go
Normal file
18
test/typeparam/issue50481c.dir/main.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Test that type substitution works and export/import works correctly even for a
|
||||
// generic type that has multiple blank type params.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"./a"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var x a.T[int, a.Myint, string]
|
||||
fmt.Printf("%v\n", x)
|
||||
}
|
||||
Reference in New Issue
Block a user