aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata
diff options
context:
space:
mode:
authorMarco Manino <[email protected]>2024-02-13 17:48:19 +0100
committerAyke <[email protected]>2024-05-13 16:49:18 +0200
commitcef2a82c97eeef34fffe72b4cbc60239114dec26 (patch)
treeaa3795eb8cda67c646aebf4d2ccb638c4b717342 /testdata
parent1d9f26cee1f1501b09647186a25ba29aa6a0c58c (diff)
downloadtinygo-cef2a82c97eeef34fffe72b4cbc60239114dec26.tar.gz
tinygo-cef2a82c97eeef34fffe72b4cbc60239114dec26.zip
Checking for methodset existance
Diffstat (limited to 'testdata')
-rw-r--r--testdata/init.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/testdata/init.go b/testdata/init.go
index fa470fd54..8b34db3f3 100644
--- a/testdata/init.go
+++ b/testdata/init.go
@@ -109,3 +109,14 @@ func sliceString(s string, start, end int) string {
func sliceSlice(s []int, start, end int) []int {
return s[start:end]
}
+
+type outside struct{}
+
+func init() {
+ _, _ = any(0).(interface{ DoesNotExist() })
+ _, _ = any("").(interface{ DoesNotExist() })
+ _, _ = any(outside{}).(interface{ DoesNotExist() })
+
+ type inside struct{}
+ _, _ = any(inside{}).(interface{ DoesNotExist() })
+}