1// run 2 3// Copyright 2019 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// Check static composite literal reports wrong for struct 8// field. 9 10package main 11 12type one struct { 13 i interface{} 14} 15 16type two struct { 17 i interface{} 18 s []string 19} 20 21func main() { 22 o := one{i: two{i: 42}.i} 23 println(o.i.(int)) 24} 25