aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd/compile/internal/types2/api_test.go5
-rw-r--r--src/go/types/api_test.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/api_test.go b/src/cmd/compile/internal/types2/api_test.go
index 44fb6afe98..0d3c8b8e3e 100644
--- a/src/cmd/compile/internal/types2/api_test.go
+++ b/src/cmd/compile/internal/types2/api_test.go
@@ -358,6 +358,11 @@ func TestTypesInfo(t *testing.T) {
// go.dev/issue/47895
{`package p; import "unsafe"; type S struct { f int }; var s S; var _ = unsafe.Offsetof(s.f)`, `s.f`, `int`},
+ // go.dev/issue/74303. Note that interface field types are synthetic, so
+ // even though `func()` doesn't appear in the source, it appears in the
+ // syntax tree.
+ {`package p; type T interface { M(int) }`, `func(int)`, `func(int)`},
+
// go.dev/issue/50093
{`package u0a; func _[_ interface{int}]() {}`, `int`, `int`},
{`package u1a; func _[_ interface{~int}]() {}`, `~int`, `~int`},
diff --git a/src/go/types/api_test.go b/src/go/types/api_test.go
index f5a911306f..4396b8ae89 100644
--- a/src/go/types/api_test.go
+++ b/src/go/types/api_test.go
@@ -364,6 +364,11 @@ func TestTypesInfo(t *testing.T) {
// go.dev/issue/47895
{`package p; import "unsafe"; type S struct { f int }; var s S; var _ = unsafe.Offsetof(s.f)`, `s.f`, `int`},
+ // go.dev/issue/74303. Note that interface field types are synthetic, so
+ // even though `func()` doesn't appear in the source, it appears in the
+ // syntax tree.
+ {`package p; type T interface { M(int) }`, `func(int)`, `func(int)`},
+
// go.dev/issue/50093
{`package u0a; func _[_ interface{int}]() {}`, `int`, `int`},
{`package u1a; func _[_ interface{~int}]() {}`, `~int`, `~int`},