Source file test/fixedbugs/issue46386.go

     1  // compile -p=main
     2  
     3  // Copyright 2021 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 main
     8  
     9  type I interface {
    10  	M() interface{}
    11  }
    12  
    13  type S1 struct{}
    14  
    15  func (S1) M() interface{} {
    16  	return nil
    17  }
    18  
    19  type EI interface{}
    20  
    21  type S struct{}
    22  
    23  func (S) M(as interface{ I }) {}
    24  
    25  func f() interface{ EI } {
    26  	return &S1{}
    27  }
    28  
    29  func main() {
    30  	var i interface{ I }
    31  	(&S{}).M(i)
    32  }
    33  

View as plain text