Source file test/fixedbugs/issue42703.go

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

View as plain text