1// run
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
7package main
8
9var ok [2]bool
10
11func main() {
12	f()()
13	if !ok[0] || !ok[1] {
14		panic("FAIL")
15	}
16}
17
18func f() func() { ok[0] = true; return g }
19func g()        { ok[1] = true }
20