diff options
author | Robert Griesemer <gri@golang.org> | 2023-05-03 22:05:27 -0700 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-05-04 17:35:44 +0000 |
commit | fc106b016cc4ba5dc5a1a44eda7524fdce4463bb (patch) | |
tree | 6cdd94bda1231af741cda692507d1f832625fcbb /src/internal | |
parent | 13201d57283e3684ab46ccb5ee0bb6b3fe67c221 (diff) | |
download | go-git-fc106b016cc4ba5dc5a1a44eda7524fdce4463bb.tar.gz |
go/types, types2: remove Config.EnableReverseTypeInference flag
Proposal #59338 has been accepted and we expect this feature to
be available starting with Go 1.21. Remove the flag to explicitly
enable it through the API and enable by default.
For now keep an internal constant enableReverseTypeInference to
guard and mark the respective code, so we can disable it for
debugging purposes.
For #59338.
Change-Id: Ia1bf3032483ae603017a0f459417ec73837e2891
Reviewed-on: https://go-review.googlesource.com/c/go/+/491798
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/internal')
7 files changed, 5 insertions, 11 deletions
diff --git a/src/internal/types/testdata/examples/inference.go b/src/internal/types/testdata/examples/inference.go index 2dc122c413..b6f735263e 100644 --- a/src/internal/types/testdata/examples/inference.go +++ b/src/internal/types/testdata/examples/inference.go @@ -1,3 +1,5 @@ +// -lang=go1.20 + // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -154,4 +156,4 @@ func _() { func f[P any](P) {} // This must not crash. -var _ func(int) = f // ERROR "cannot use generic function f without instantiation" +var _ func(int) = f // ERROR "implicitly instantiated function in assignment requires go1.21 or later" diff --git a/src/internal/types/testdata/examples/inference2.go b/src/internal/types/testdata/examples/inference2.go index 7b86266d5e..4eeb6d1b05 100644 --- a/src/internal/types/testdata/examples/inference2.go +++ b/src/internal/types/testdata/examples/inference2.go @@ -1,5 +1,3 @@ -// -reverseTypeInference - // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/src/internal/types/testdata/fixedbugs/issue59338a.go b/src/internal/types/testdata/fixedbugs/issue59338a.go index f927813e10..34864dcd30 100644 --- a/src/internal/types/testdata/fixedbugs/issue59338a.go +++ b/src/internal/types/testdata/fixedbugs/issue59338a.go @@ -1,4 +1,4 @@ -// -reverseTypeInference -lang=go1.20 +// -lang=go1.20 // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/src/internal/types/testdata/fixedbugs/issue59338b.go b/src/internal/types/testdata/fixedbugs/issue59338b.go index ea321bcd17..1a5530aeae 100644 --- a/src/internal/types/testdata/fixedbugs/issue59338b.go +++ b/src/internal/types/testdata/fixedbugs/issue59338b.go @@ -1,5 +1,3 @@ -// -reverseTypeInference - // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/src/internal/types/testdata/fixedbugs/issue59639.go b/src/internal/types/testdata/fixedbugs/issue59639.go index c82d5b10fa..1117668e98 100644 --- a/src/internal/types/testdata/fixedbugs/issue59639.go +++ b/src/internal/types/testdata/fixedbugs/issue59639.go @@ -1,4 +1,4 @@ -// -reverseTypeInference -lang=go1.17 +// -lang=go1.17 // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/src/internal/types/testdata/fixedbugs/issue59953.go b/src/internal/types/testdata/fixedbugs/issue59953.go index 40d97378a2..b10ced749b 100644 --- a/src/internal/types/testdata/fixedbugs/issue59953.go +++ b/src/internal/types/testdata/fixedbugs/issue59953.go @@ -1,5 +1,3 @@ -// -reverseTypeInference - // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/src/internal/types/testdata/fixedbugs/issue59956.go b/src/internal/types/testdata/fixedbugs/issue59956.go index 33b05d72c1..646b50e771 100644 --- a/src/internal/types/testdata/fixedbugs/issue59956.go +++ b/src/internal/types/testdata/fixedbugs/issue59956.go @@ -1,5 +1,3 @@ -// -reverseTypeInference - // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. |