| 1 |
// This file is the input to TestValueForExprStructConv in identical_test.go, |
| 2 |
// which uses the same framework as TestValueForExpr does in source_test.go. |
| 3 |
// |
| 4 |
// In Go 1.8, struct conversions are permitted even when the struct types have |
| 5 |
// different tags. This wasn't permitted in earlier versions of Go, so this file |
| 6 |
// exists separately from valueforexpr.go to just test this behavior in Go 1.8 |
| 7 |
// and later. |
| 8 |
|
| 9 |
package main |
| 10 |
|
| 11 |
type t1 struct { |
| 12 |
x int |
| 13 |
} |
| 14 |
type t2 struct { |
| 15 |
x int `tag` |
| 16 |
} |
| 17 |
|
| 18 |
func main() { |
| 19 |
var tv1 t1 |
| 20 |
var tv2 t2 = /*@ChangeType*/ (t2(tv1)) |
| 21 |
_ = tv2 |
| 22 |
} |