Skip to content

Commit

Permalink
test: add regression test for issue 54911
Browse files Browse the repository at this point in the history
It was fixed by CL 422196, and have been already worked in unified IR.

Fixes #54911

Change-Id: Ie69044a64b296f6961e667e7661d8c4d1a24d84e
Reviewed-on: https://go-review.googlesource.com/c/go/+/428758
Auto-Submit: Cuong Manh Le <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
Run-TryBot: Cuong Manh Le <[email protected]>
Reviewed-by: Matthew Dempsky <[email protected]>
  • Loading branch information
cuonglm authored and gopherbot committed Sep 7, 2022
1 parent 2e1f98e commit 5a96386
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/fixedbugs/issue54911.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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 main

type Set[T comparable] map[T]struct{}

func (s Set[T]) Add() Set[T] {
return s
}

func (s Set[T]) Copy() Set[T] {
return Set[T].Add(s)
}

func main() {
_ = Set[int]{42: {}}
}

0 comments on commit 5a96386

Please sign in to comment.