]> Cypherpunks repositories - gostls13.git/commitdiff
internal/goexperiment: add aliastypeparams GOEXPERIMENT flag
authorRobert Griesemer <gri@golang.org>
Mon, 20 May 2024 21:00:06 +0000 (14:00 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 21 May 2024 16:19:47 +0000 (16:19 +0000)
For #46477.

Change-Id: Ic917272cb2cd28dcb39f173b3cdcfb72e52eae2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/586955
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>

src/internal/goexperiment/exp_aliastypeparams_off.go [new file with mode: 0644]
src/internal/goexperiment/exp_aliastypeparams_on.go [new file with mode: 0644]
src/internal/goexperiment/flags.go

diff --git a/src/internal/goexperiment/exp_aliastypeparams_off.go b/src/internal/goexperiment/exp_aliastypeparams_off.go
new file mode 100644 (file)
index 0000000..620d34e
--- /dev/null
@@ -0,0 +1,8 @@
+// Code generated by mkconsts.go. DO NOT EDIT.
+
+//go:build !goexperiment.aliastypeparams
+
+package goexperiment
+
+const AliasTypeParams = false
+const AliasTypeParamsInt = 0
diff --git a/src/internal/goexperiment/exp_aliastypeparams_on.go b/src/internal/goexperiment/exp_aliastypeparams_on.go
new file mode 100644 (file)
index 0000000..8f6872c
--- /dev/null
@@ -0,0 +1,8 @@
+// Code generated by mkconsts.go. DO NOT EDIT.
+
+//go:build goexperiment.aliastypeparams
+
+package goexperiment
+
+const AliasTypeParams = true
+const AliasTypeParamsInt = 1
index 7f6c223ed69f5c36ead848a087e9e61a18ad2edf..3f9c5af68e36ebf2693ffc0aea9bff5b923830c2 100644 (file)
@@ -110,4 +110,9 @@ type Flags struct {
 
        // RangeFunc enables range over func.
        RangeFunc bool
+
+       // AliasTypeParams enables type parameters for alias types.
+       // Requires that gotypesalias=1 is set with GODEBUG.
+       // This flag will be removed with Go 1.24.
+       AliasTypeParams bool
 }