summaryrefslogtreecommitdiffstats
path: root/test/fixedbugs/issue4326.dir
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs/issue4326.dir')
-rw-r--r--test/fixedbugs/issue4326.dir/p1.go12
-rw-r--r--test/fixedbugs/issue4326.dir/p2.go5
-rw-r--r--test/fixedbugs/issue4326.dir/q1.go8
-rw-r--r--test/fixedbugs/issue4326.dir/q2.go11
-rw-r--r--test/fixedbugs/issue4326.dir/z.go7
5 files changed, 43 insertions, 0 deletions
diff --git a/test/fixedbugs/issue4326.dir/p1.go b/test/fixedbugs/issue4326.dir/p1.go
new file mode 100644
index 0000000..ab214be
--- /dev/null
+++ b/test/fixedbugs/issue4326.dir/p1.go
@@ -0,0 +1,12 @@
+package p1
+
+type O map[string]map[string]string
+
+func (opts O) RemoveOption(sect, opt string) bool {
+ if _, ok := opts[sect]; !ok {
+ return false
+ }
+ _, ok := opts[sect][opt]
+ delete(opts[sect], opt)
+ return ok
+}
diff --git a/test/fixedbugs/issue4326.dir/p2.go b/test/fixedbugs/issue4326.dir/p2.go
new file mode 100644
index 0000000..8e86266
--- /dev/null
+++ b/test/fixedbugs/issue4326.dir/p2.go
@@ -0,0 +1,5 @@
+package p2
+
+import "./p1"
+
+func NewO() p1.O { return nil }
diff --git a/test/fixedbugs/issue4326.dir/q1.go b/test/fixedbugs/issue4326.dir/q1.go
new file mode 100644
index 0000000..f118eb0
--- /dev/null
+++ b/test/fixedbugs/issue4326.dir/q1.go
@@ -0,0 +1,8 @@
+package q1
+
+func Deref(typ interface{}) interface{} {
+ if typ, ok := typ.(*int); ok {
+ return *typ
+ }
+ return typ
+}
diff --git a/test/fixedbugs/issue4326.dir/q2.go b/test/fixedbugs/issue4326.dir/q2.go
new file mode 100644
index 0000000..075e2b2
--- /dev/null
+++ b/test/fixedbugs/issue4326.dir/q2.go
@@ -0,0 +1,11 @@
+package main
+
+import "./q1"
+
+func main() {
+ x := 1
+ y := q1.Deref(&x)
+ if y != 1 {
+ panic("y != 1")
+ }
+}
diff --git a/test/fixedbugs/issue4326.dir/z.go b/test/fixedbugs/issue4326.dir/z.go
new file mode 100644
index 0000000..9b222e8
--- /dev/null
+++ b/test/fixedbugs/issue4326.dir/z.go
@@ -0,0 +1,7 @@
+package z
+
+import "./p2"
+
+func main() {
+ p2.NewO().RemoveOption("hello", "world")
+}