modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/interface/convert1.go (about)

     1  // run
     2  
     3  // Copyright 2009 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  // Test static interface conversion of interface value nil.
     8  
     9  package main
    10  
    11  type R interface { R() }
    12  type RW interface { R(); W() }
    13  
    14  var e interface {}
    15  var r R
    16  var rw RW
    17  
    18  func main() {
    19  	r = r
    20  	r = rw
    21  	e = r
    22  	e = rw
    23  	rw = rw
    24  }