-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add regress test for issue 55101
This test case already works with GOEXPERIMENT=unified, and it never worked with Go 1.18 or Go 1.19. So this CL simply adds a regress test to make sure it continues working. Fixes golang#55101. Change-Id: I7e06bfdc136ce124f65cdcf02d20a1050b841d42 Reviewed-on: https://go-review.googlesource.com/c/go/+/431455 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// compile | ||
|
||
// 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 p | ||
|
||
func F() *Cache[error] { return nil } | ||
|
||
type Cache[T any] struct{ l *List[entry[T]] } | ||
type entry[T any] struct{ value T } | ||
type List[T any] struct{ len int } | ||
|
||
func (c *Cache[V]) Len() int { return c.l.Len() } | ||
func (l *List[T]) Len() int { return l.len } |