]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: handle `any` as alias like `byte` and `rune`
authorMatthew Dempsky <mdempsky@google.com>
Thu, 18 Nov 2021 21:43:04 +0000 (13:43 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 19 Nov 2021 22:35:28 +0000 (22:35 +0000)
commitb31dda8a2ad833ea5ec3c807119372b27cc0e782
treeb9fb25c53b4bfde205ef9a67f7025af0c016b5ba
parent5e774b0f5c9e9d5a0dab94620d2e0030226148c2
cmd/compile: handle `any` as alias like `byte` and `rune`

`types.Types[types.TINTER]` is already used for `interface{}`, so we
can conveniently just extend the existing logic that substitutes
`byte` and `rune` with `uint8` and `int32` to also substitute `any`.

Fixes #49665.

Change-Id: I1ab1954699934150aab899b35037d5611c8ca47e
Reviewed-on: https://go-review.googlesource.com/c/go/+/365354
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/types/fmt.go
src/cmd/compile/internal/types/identity.go
src/cmd/compile/internal/types/type.go
src/cmd/compile/internal/types/universe.go
test/fixedbugs/issue49665.go [new file with mode: 0644]
test/fixedbugs/issue49665.out [new file with mode: 0644]