Source file test/fixedbugs/issue81286.dir/main.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"./a"
     9  	"./b"
    10  )
    11  
    12  type A struct {
    13  	a.W
    14  }
    15  
    16  type B struct {
    17  	b.W
    18  }
    19  
    20  type I interface {
    21  	M(int)
    22  }
    23  
    24  type J interface {
    25  	M()
    26  }
    27  
    28  var x I
    29  var y J
    30  
    31  func init() {
    32  	x = A{}
    33  	y = B{}
    34  }
    35  
    36  func main() {
    37  	x.M(81286)
    38  	y.M()
    39  
    40  	if a.Last != 81286 {
    41  		panic(a.Last)
    42  	}
    43  	if !b.Called {
    44  		panic("b.W.M was not called")
    45  	}
    46  }
    47  

View as plain text