summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/issue22683.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs/issue22683.go')
-rw-r--r--test/fixedbugs/issue22683.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/fixedbugs/issue22683.go b/test/fixedbugs/issue22683.go
new file mode 100644
index 0000000..47c7f65
--- /dev/null
+++ b/test/fixedbugs/issue22683.go
@@ -0,0 +1,30 @@
+// run
+
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "fmt"
+)
+
+type foo struct {
+ bar [1]*int
+}
+
+func main() {
+ ch := make(chan foo, 2)
+ var a int
+ var b [1]*int
+ b[0] = &a
+ ch <- foo{bar: b}
+ close(ch)
+
+ for v := range ch {
+ for i := 0; i < 1; i++ {
+ fmt.Println(v.bar[0] != nil)
+ }
+ }
+}