From 43a123c1ae6613b3efeed291fa552ecd909d3acf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:23:18 +0200 Subject: Adding upstream version 1.20.14. Signed-off-by: Daniel Baumann --- test/fixedbugs/issue4326.dir/p1.go | 12 ++++++++++++ test/fixedbugs/issue4326.dir/p2.go | 5 +++++ test/fixedbugs/issue4326.dir/q1.go | 8 ++++++++ test/fixedbugs/issue4326.dir/q2.go | 11 +++++++++++ test/fixedbugs/issue4326.dir/z.go | 7 +++++++ 5 files changed, 43 insertions(+) create mode 100644 test/fixedbugs/issue4326.dir/p1.go create mode 100644 test/fixedbugs/issue4326.dir/p2.go create mode 100644 test/fixedbugs/issue4326.dir/q1.go create mode 100644 test/fixedbugs/issue4326.dir/q2.go create mode 100644 test/fixedbugs/issue4326.dir/z.go (limited to 'test/fixedbugs/issue4326.dir') 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") +} -- cgit v1.2.3