From 4ab70f164799fc03bb4bf05531cb95422d64f436 Mon Sep 17 00:00:00 2001 From: visualfc Date: Tue, 12 Nov 2024 22:41:16 +0800 Subject: [PATCH] cl: TestEmbedField --- cl/compile_gop_test.go | 33 +++++++++++++++++++++++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/cl/compile_gop_test.go b/cl/compile_gop_test.go index be836b389..04742bf25 100644 --- a/cl/compile_gop_test.go +++ b/cl/compile_gop_test.go @@ -1597,3 +1597,36 @@ func main() { } `) } + +func TestEmbedField(t *testing.T) { + gopClTest(t, `package main + +type Info struct { + id int +} +type T struct { + Info + id string +} +func demo(t *T) { + t.id = "0" +} +func main() { +} +`, `package main + +type Info struct { + id int +} +type T struct { + Info + id string +} + +func demo(t *T) { + t.id = "0" +} +func main() { +} +`) +} diff --git a/go.mod b/go.mod index 828ee1acf..4a815a6ba 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/fsnotify/fsnotify v1.8.0 - github.com/goplus/gogen v1.16.2 + github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee github.com/goplus/llgo v0.9.7 github.com/goplus/mod v0.13.12 github.com/qiniu/x v1.13.10 diff --git a/go.sum b/go.sum index 7105c5a3d..41a6e1a45 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/goplus/gogen v1.16.2 h1:u8uaNGUW0csXp9Ar6/1SzRfPRebvVhiqTvFHvOsnTZY= -github.com/goplus/gogen v1.16.2/go.mod h1:6TQYbabXDF9LCdDkOOzHmfg1R4ENfXQ3XpHa9RhTSD8= +github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee h1:lwV/kdyMI18qF70vd+ur2/rAdmoA+Zy+c/btdDiiYt8= +github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee/go.mod h1:6TQYbabXDF9LCdDkOOzHmfg1R4ENfXQ3XpHa9RhTSD8= github.com/goplus/llgo v0.9.7 h1:LRF2Fq9ts4QrVxOPZufexalbIoJ1oiBERjCWQ45wxbg= github.com/goplus/llgo v0.9.7/go.mod h1:5Fs+08NslqofJ7xtOiIXugkurYOoQvY02ZkFNWA1uEI= github.com/goplus/mod v0.13.12 h1:Trwk6j3i9VvBuW6/9ZxmkoFlEL2v3HKQu0Na1c6DAdw=