1// compile 2 3// Copyright 2023 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 p 8 9type S[T comparable] struct { 10 m map[T]T 11} 12 13func (s S[T]) M1(node T) { 14 defer delete(s.m, node) 15} 16 17func (s S[T]) M2(node T) { 18 defer func() { 19 delete(s.m, node) 20 }() 21} 22 23func (s S[T]) M3(node T) { 24 defer f(s.m, node) 25} 26 27//go:noinline 28func f[T comparable](map[T]T, T) {} 29 30var _ = S[int]{} 31