]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: implement type checking of "clear" built-in
authorRobert Griesemer <gri@golang.org>
Fri, 4 Nov 2022 22:12:32 +0000 (15:12 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Nov 2022 17:24:51 +0000 (17:24 +0000)
commit5c834a2eb051a0227814b5ea31437aac3ade100c
treeabf7353dad762b964e164058151ed2fbfbe489bc
parentcafb49ac731f862f386862d64b27b8314eeb2909
go/types, types2: implement type checking of "clear" built-in

Will become available with Go 1.21.

Recognizing the `clear` built-in early is not causing any problems:
if existing code defines a `clear`, that will be used as before. If
code doesn't define `clear` the error message will make it clear
that with 1.21 the function will be available. It's still possible
to define a local `clear` and get rid of the error; but more likely
the name choice should be avoided going forward, so this provides a
useful early "heads-up".

For #56351.

Change-Id: I3d0fb1eb3508fbc78d7514b6238eac89610158c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/448076
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/builtins_test.go
src/cmd/compile/internal/types2/universe.go
src/go/types/builtins.go
src/go/types/builtins_test.go
src/go/types/universe.go
src/internal/types/errors/codes.go
src/internal/types/testdata/check/builtins0.go
src/internal/types/testdata/check/builtins1.go
src/internal/types/testdata/fixedbugs/issue56351.go [new file with mode: 0644]