Skip to content

Commit 7865e80

Browse files
authored
Merge pull request #2014 from visualfc/embedfield
cl: TestEmbedField
2 parents 0d0f624 + 4ab70f1 commit 7865e80

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

cl/compile_gop_test.go

+33
Original file line numberDiff line numberDiff line change
@@ -1597,3 +1597,36 @@ func main() {
15971597
}
15981598
`)
15991599
}
1600+
1601+
func TestEmbedField(t *testing.T) {
1602+
gopClTest(t, `package main
1603+
1604+
type Info struct {
1605+
id int
1606+
}
1607+
type T struct {
1608+
Info
1609+
id string
1610+
}
1611+
func demo(t *T) {
1612+
t.id = "0"
1613+
}
1614+
func main() {
1615+
}
1616+
`, `package main
1617+
1618+
type Info struct {
1619+
id int
1620+
}
1621+
type T struct {
1622+
Info
1623+
id string
1624+
}
1625+
1626+
func demo(t *T) {
1627+
t.id = "0"
1628+
}
1629+
func main() {
1630+
}
1631+
`)
1632+
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/fsnotify/fsnotify v1.8.0
7-
github.com/goplus/gogen v1.16.2
7+
github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee
88
github.com/goplus/llgo v0.9.7
99
github.com/goplus/mod v0.13.12
1010
github.com/qiniu/x v1.13.10

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
22
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
3-
github.com/goplus/gogen v1.16.2 h1:u8uaNGUW0csXp9Ar6/1SzRfPRebvVhiqTvFHvOsnTZY=
4-
github.com/goplus/gogen v1.16.2/go.mod h1:6TQYbabXDF9LCdDkOOzHmfg1R4ENfXQ3XpHa9RhTSD8=
3+
github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee h1:lwV/kdyMI18qF70vd+ur2/rAdmoA+Zy+c/btdDiiYt8=
4+
github.com/goplus/gogen v1.16.3-0.20241112142719-46167891a7ee/go.mod h1:6TQYbabXDF9LCdDkOOzHmfg1R4ENfXQ3XpHa9RhTSD8=
55
github.com/goplus/llgo v0.9.7 h1:LRF2Fq9ts4QrVxOPZufexalbIoJ1oiBERjCWQ45wxbg=
66
github.com/goplus/llgo v0.9.7/go.mod h1:5Fs+08NslqofJ7xtOiIXugkurYOoQvY02ZkFNWA1uEI=
77
github.com/goplus/mod v0.13.12 h1:Trwk6j3i9VvBuW6/9ZxmkoFlEL2v3HKQu0Na1c6DAdw=

0 commit comments

Comments
 (0)