Source file test/fixedbugs/issue54991.go

     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  
     7  package p
     8  
     9  import (
    10  	"sync/atomic"
    11  )
    12  
    13  type I interface {
    14  	M()
    15  }
    16  
    17  type S struct{}
    18  
    19  func (*S) M() {}
    20  
    21  type T struct {
    22  	I
    23  	x atomic.Int64
    24  }
    25  
    26  func F() {
    27  	t := &T{I: &S{}}
    28  	t.M()
    29  }
    30  

View as plain text