Source file test/fixedbugs/issue52870.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  // Issue 52870: gofrontend gave incorrect error when incorrectly
     8  // compiling ambiguous promoted method.
     9  
    10  package p
    11  
    12  type S1 struct {
    13  	*S2
    14  }
    15  
    16  type S2 struct {
    17  	T3
    18  	T4
    19  }
    20  
    21  type T3 int32
    22  
    23  func (T3) M() {}
    24  
    25  type T4 int32
    26  
    27  func (T4) M() {}
    28  

View as plain text