internal/buildcfg: flip default of GenericMethods

This is effectively a revert of CL 779221 which flipped the behavior
of GOEXPERIMENT=genericmethods. It's much more natural to just flip
the default for the experiment and keep everything else the same.

We'll need to repeat CL 779221 when we go to turn down the experiment
sometime before the release.

For #77273

Change-Id: I18b6268c270451bee1ad3f20cbf92ca42170b032
Reviewed-on: https://go-review.googlesource.com/c/go/+/779301
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
This commit is contained in:
Mark Freeman 2026-05-18 15:12:10 -04:00
parent 21e3cdefc3
commit e212a16d1e
7 changed files with 11 additions and 6 deletions

View file

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build goexperiment.genericmethods
package importer
import (

View file

@ -26,12 +26,12 @@ import (
)
// uirVersion is the unified IR version to use for encoding/decoding.
// Use V4 for generic methods. Revert to V3 if the GOEXPERIMENT is enabled.
// Use V4 for generic methods if the GOEXPERIMENT is enabled.
var uirVersion = func() pkgbits.Version {
if buildcfg.Experiment.GenericMethods {
return pkgbits.V3
return pkgbits.V4
}
return pkgbits.V4
return pkgbits.V3
}()
// localPkgReader holds the package reader used for reading the local

View file

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build goexperiment.genericmethods
package gcimporter_test
import (

View file

@ -85,6 +85,7 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (*ExperimentFlags, error) {
RandomizedHeapBase64: true,
GreenTeaGC: true,
JSONv2: true,
GenericMethods: true,
}
flags := &ExperimentFlags{
Flags: baseline,

View file

@ -1,4 +1,4 @@
// run
// run -goexperiment genericmethods
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style

View file

@ -1,4 +1,4 @@
// run
// run -goexperiment genericmethods
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style

View file

@ -1,4 +1,4 @@
// run
// run -goexperiment genericmethods
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style