diff options
author | Robert Griesemer <gri@golang.org> | 2024-04-18 08:51:27 -0700 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-04-18 17:42:47 +0000 |
commit | ad87d4404782d816f7a4497113b6b983b45aa442 (patch) | |
tree | 9b9985f0b52ae0823ee1064f7c16e7a7309c4d7e /src/go | |
parent | a0205e650a2a802b82e7f924e43d4a9adfb3ac36 (diff) | |
download | go-ad87d4404782d816f7a4497113b6b983b45aa442.tar.gz go-ad87d4404782d816f7a4497113b6b983b45aa442.zip |
go/types, types2: use correct predicate when asserting comma-ok types
While at it and unrelated, up-date testdata/manual.go sample file so
we can just copy its contents into a test file after debugging, without
fixing the date.
Fixes #66878.
Change-Id: Ie49a341b78d99bdc0f1a0ba1ca42fa2d3a807bd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/580075
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/go')
-rw-r--r-- | src/go/types/check.go | 2 | ||||
-rw-r--r-- | src/go/types/testdata/manual.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/go/types/check.go b/src/go/types/check.go index 87106c4d01..94f2bbfd78 100644 --- a/src/go/types/check.go +++ b/src/go/types/check.go @@ -579,7 +579,7 @@ func (check *Checker) recordCommaOkTypes(x ast.Expr, a []*operand) { return } t0, t1 := a[0].typ, a[1].typ - assert(isTyped(t0) && isTyped(t1) && (isBoolean(t1) || t1 == universeError)) + assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError)) if m := check.Types; m != nil { for { tv := m[x] diff --git a/src/go/types/testdata/manual.go b/src/go/types/testdata/manual.go index 57dcc227a5..d8f312f61d 100644 --- a/src/go/types/testdata/manual.go +++ b/src/go/types/testdata/manual.go @@ -1,4 +1,4 @@ -// Copyright 2023 The Go Authors. All rights reserved. +// Copyright 2024 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. |