Source file test/fixedbugs/issue21120.dir/b.go

     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 b
     6  
     7  import "reflect"
     8  
     9  type X int
    10  
    11  func F1() string {
    12  	type x X
    13  
    14  	s := struct {
    15  		*x
    16  	}{nil}
    17  	v := reflect.TypeOf(s)
    18  	return v.Field(0).PkgPath
    19  }
    20  
    21  func F2() string {
    22  	type y X
    23  
    24  	s := struct {
    25  		*y
    26  	}{nil}
    27  	v := reflect.TypeOf(s)
    28  	return v.Field(0).PkgPath
    29  }
    30  

View as plain text