Repository: goplus/gop
Pull request #2019 (2024-11-20 23:38:09)

mini spec: Label scopes, Blank identifier


Patch:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 1647fd4c..ab059676 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -48,7 +48,7 @@ jobs:
       run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
 
     - name: Codecov
-      uses: codecov/codecov-action@v5
+      uses: codecov/codecov-action@v4
       with:
         token: ${{ secrets.CODECOV_TOKEN }}
         slug: goplus/gop
diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml
index a90318a7..6f10496b 100644
--- a/.github/workflows/release-build.yml
+++ b/.github/workflows/release-build.yml
@@ -19,7 +19,7 @@ jobs:
         python .github/workflows/check_goreleaser_config.py
 
     - name: Install Snapcraft
-      uses: samuelmeuli/action-snapcraft@v3
+      uses: samuelmeuli/action-snapcraft@v2
 
     - name: Checkout tag
       run: |
diff --git a/doc/spec-mini.md b/doc/spec-mini.md
index d24ae029..c09b2edf 100644
--- a/doc/spec-mini.md
+++ b/doc/spec-mini.md
@@ -1764,6 +1764,15 @@ The [package clause]() is not a declaration; the package name does not appear in
 
 ### Label scopes
 
+Labels are declared by [labeled statements](#labeled-statements) and are used in the "[break](#break-statements)", "[continue](#continue-statements)", and "[goto](#goto-statements)" statements. It is illegal to define a label that is never used. In contrast to other identifiers, labels are not block scoped and do not conflict with identifiers that are not labels. The scope of a label is the body of the function in which it is declared and excludes the body of any nested function.
+
+
+### Blank identifier
+
+The _blank identifier_ is represented by the underscore character `_`. It serves as an anonymous placeholder instead of a regular (non-blank) identifier and has special meaning in [declarations](#declarations-and-scope), as an [operand](), and in [assignment statements](#assignment-statements).
+
+### Predeclared identifiers
+
 TODO
 
 
diff --git a/go.mod b/go.mod
index 4a815a6b..3a5d2782 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.3-0.20241112142719-46167891a7ee
+	github.com/goplus/gogen v1.16.2-0.20241108030022-38cdc04c7425
 	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 41a6e1a4..f5a4f1c3 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.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/gogen v1.16.2-0.20241108030022-38cdc04c7425 h1:sbzi0nY672ZJJCaNVez31tryu0otBL/5WfZ6UQ61M4I=
+github.com/goplus/gogen v1.16.2-0.20241108030022-38cdc04c7425/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=


Test patch:
diff --git a/cl/compile_gop_test.go b/cl/compile_gop_test.go
index 04742bf2..be836b38 100644
--- a/cl/compile_gop_test.go
+++ b/cl/compile_gop_test.go
@@ -1597,36 +1597,3 @@ 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() {
-}
-`)
-}