Source file test/fixedbugs/issue14321.go

     1  // errorcheck
     2  
     3  // Copyright 2018 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  // Verify that error message reports _ambiguous_ method.
     8  
     9  package p
    10  
    11  type A struct{
    12  	H int
    13  }
    14  
    15  func (A) F() {}
    16  func (A) G() {}
    17  
    18  type B struct{
    19  	G int
    20  	H int
    21  }
    22  
    23  func (B) F() {}
    24  
    25  type C struct {
    26  	A
    27  	B
    28  }
    29  
    30  var _ = C.F // ERROR "ambiguous"
    31  var _ = C.G // ERROR "ambiguous"
    32  var _ = C.H // ERROR "ambiguous"
    33  var _ = C.I // ERROR "no method .*I.*|C.I undefined"
    34  

View as plain text