Skip to content

Commit 236ad5a

Browse files
committed
[dev.go2go] go/types: fix broken test case
While at it, simplified test case a bit. Fixes #39935. Updates #39754. Change-Id: Ia3b51f23807d25e62113757c51a660c7e3a9b381 Reviewed-on: https://go-review.googlesource.com/c/go/+/240478 Reviewed-by: Robert Griesemer <[email protected]>
1 parent 71c7be5 commit 236ad5a

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/go/types/fixedbugs/issue39754.go2

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,19 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
package main
5+
package p
66

7-
type Optional(type T) struct {
8-
p T
9-
set bool
10-
}
7+
type Optional(type T) struct {}
118

12-
func (o Optional(T)) Val() (T, bool) {
13-
return o.p, true
14-
}
9+
func (_ Optional(T)) Val() (T, bool)
1510

1611
type Box(type T) interface {
1712
Val() (T, bool)
1813
}
1914

20-
func F1(type V interface{}, A, B Box(V))() {}
15+
func f(type V interface{}, A, B Box(V))() {}
2116

22-
func main() {
23-
F1(int, Optional(int), Optional(int))()
24-
F1(int, Optional(int), Optional(string) /* ERROR "does not satisfy Box(V) (missing method Val)" */)()
25-
}
17+
func _() {
18+
f(int, Optional(int), Optional(int))()
19+
f(int, Optional(int), Optional /* ERROR does not satisfy Box */ (string))()
20+
}

0 commit comments

Comments
 (0)