aboutsummaryrefslogtreecommitdiff
path: root/test/notinheap.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/notinheap.go')
-rw-r--r--test/notinheap.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/notinheap.go b/test/notinheap.go
index 16c3f8faf0..a2284a5068 100644
--- a/test/notinheap.go
+++ b/test/notinheap.go
@@ -52,6 +52,14 @@ type t3 byte
//go:notinheap
type t4 rune
+// Type aliases inherit the go:notinheap-ness of the type they alias.
+type nihAlias = nih
+
+type embedAlias1 struct { // ERROR "must be go:notinheap"
+ x nihAlias
+}
+type embedAlias2 [1]nihAlias // ERROR "must be go:notinheap"
+
var sink interface{}
func i() {