]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: convert untyped arguments to delete
authorMatthew Dempsky <mdempsky@google.com>
Thu, 21 Jan 2021 01:03:36 +0000 (17:03 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 21 Jan 2021 01:24:50 +0000 (01:24 +0000)
commit455c29af83524a484ac407a35f4c69ff710d7acb
tree7d33601f8c1054beb5c003afe9484d9cf6a1f777
parentf03f934ede4db4b022f08c88e351463543832e00
[dev.typeparams] cmd/compile/internal/types2: convert untyped arguments to delete

For the predeclared "delete" function, types2 was checking that the
second argument was assignable to the map's key type, but not actually
updating the Types map as appropriate. So this could leave untyped
constants in the AST.

The error "cannot convert" is somewhat less precise than the previous
"not assignable" error, but it's consistent with how types2 reports
other erroneous assignments of untyped constants.

Change-Id: Ic3ca3a3611ad0e4646c050e93088cdf992234e5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/285059
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/testdata/builtins.src