1// compile 2 3// Copyright 2020 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// Make sure that literal value can be passed to struct 8// blank field with expressions where candiscard(value) 9// returns false, see #38905. 10 11package p 12 13type t struct{ _ u } 14type u [10]struct{ f int } 15 16func f(x int) t { return t{u{{1 / x}, {1 % x}}} } 17func g(p *int) t { return t{u{{*p}}} } 18func h(s []int) t { return t{u{{s[0]}}} } 19