Skip to content

Commit 9dcbc43

Browse files
committed
test: add test for issue 15084
The underlying issues have been fixed. All the individual fixes have their own tests, but it's still useful to have a plain source test. Fixes #15084 Change-Id: I06c485a7d0716201bd57d1f3be53668dddd7ec14 Reviewed-on: https://go-review.googlesource.com/22426 Run-TryBot: Josh Bleecher Snyder <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent f12bd8a commit 9dcbc43

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/fixedbugs/issue15084.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// compile
2+
3+
// Copyright 2016 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 x
8+
9+
type T struct {
10+
i int
11+
e interface{}
12+
}
13+
14+
func (t *T) F() bool {
15+
if t.i != 0 {
16+
return false
17+
}
18+
_, ok := t.e.(string)
19+
return ok
20+
}
21+
22+
var x int
23+
24+
func g(t *T) {
25+
if t.F() || true {
26+
if t.F() {
27+
x = 0
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)