modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/alias3.dir/c.go (about)

     1  // Copyright 2017 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  func main() {
    13  	var _ float64 = b.F(0)
    14  	var _ a.Rune = int32(0)
    15  
    16  	// embedded types can have different names but the same types
    17  	var s a.S
    18  	s.Int = 1
    19  	s.IntAlias = s.Int
    20  	s.IntAlias2 = s.Int
    21  
    22  	// aliases denote identical types across packages
    23  	var c a.Context = b.C
    24  	var _ b.MyContext = c
    25  }