From c3591cb30ce1680b97921a20a1a4aa8d96bf6292 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 20 May 2024 14:00:06 -0700 Subject: [PATCH] internal/goexperiment: add aliastypeparams GOEXPERIMENT flag For #46477. Change-Id: Ic917272cb2cd28dcb39f173b3cdcfb72e52eae2d Reviewed-on: https://go-review.googlesource.com/c/go/+/586955 Reviewed-by: Robert Griesemer Reviewed-by: Austin Clements LUCI-TryBot-Result: Go LUCI Auto-Submit: Robert Griesemer --- src/internal/goexperiment/exp_aliastypeparams_off.go | 8 ++++++++ src/internal/goexperiment/exp_aliastypeparams_on.go | 8 ++++++++ src/internal/goexperiment/flags.go | 5 +++++ 3 files changed, 21 insertions(+) create mode 100644 src/internal/goexperiment/exp_aliastypeparams_off.go create mode 100644 src/internal/goexperiment/exp_aliastypeparams_on.go diff --git a/src/internal/goexperiment/exp_aliastypeparams_off.go b/src/internal/goexperiment/exp_aliastypeparams_off.go new file mode 100644 index 0000000000..620d34ec79 --- /dev/null +++ b/src/internal/goexperiment/exp_aliastypeparams_off.go @@ -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 index 0000000000..8f6872cdcd --- /dev/null +++ b/src/internal/goexperiment/exp_aliastypeparams_on.go @@ -0,0 +1,8 @@ +// Code generated by mkconsts.go. DO NOT EDIT. + +//go:build goexperiment.aliastypeparams + +package goexperiment + +const AliasTypeParams = true +const AliasTypeParamsInt = 1 diff --git a/src/internal/goexperiment/flags.go b/src/internal/goexperiment/flags.go index 7f6c223ed6..3f9c5af68e 100644 --- a/src/internal/goexperiment/flags.go +++ b/src/internal/goexperiment/flags.go @@ -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 } -- 2.48.1