Skip to content

Commit 9ebe7c8

Browse files
committed
go/test: add a test for issue 48344
This was fixed by https://go-review.googlesource.com/c/go/+/349613 and https://go-review.googlesource.com/c/go/+/349614 Fixes #48344 Change-Id: I4c62109fd34b20566b07fcca87fb3946a5702fef Reviewed-on: https://go-review.googlesource.com/c/go/+/350309 Run-TryBot: Dan Scales <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Trust: Dan Scales <[email protected]>
1 parent 6f35430 commit 9ebe7c8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/typeparam/issue48344.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// run -gcflags=-G=3
2+
3+
// Copyright 2021 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package main
8+
9+
type G[T any] interface {
10+
g()
11+
}
12+
13+
type Foo[T any] struct {
14+
}
15+
16+
func (foo *Foo[T]) g() {
17+
18+
}
19+
20+
func f[T any]() {
21+
v := []G[T]{}
22+
v = append(v, &Foo[T]{})
23+
}
24+
func main() {
25+
f[int]()
26+
}

0 commit comments

Comments
 (0)