1// compile 2 3// Copyright 2022 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 7package main 8 9func f[T int](t T) { 10 for true { 11 func() { 12 t = func() T { return t }() 13 }() 14 } 15} 16 17func g[T int](g T) { 18 for true { 19 _ = func() T { return func(int) T { return g }(0) }() 20 } 21} 22 23func main() { 24 f(0) 25 g(0) 26} 27