diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-06-16 14:52:05 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-06-16 14:59:13 +0700 |
commit | 4d6f9d60cf597a49b918fc1d445251d6b643f860 (patch) | |
tree | 3c6dc2e466a6e903dc56dcddd925ec1ff7f76ea1 /test/fixedbugs | |
parent | ee0420d3b56982cb1600dc141dfd4be155adddfe (diff) | |
parent | 785a8f677fbba9432ee67b14d41004ba7fd35ddb (diff) | |
download | go-4d6f9d60cf597a49b918fc1d445251d6b643f860.tar.gz go-4d6f9d60cf597a49b918fc1d445251d6b643f860.zip |
[dev.typeparams] all: merge master (785a8f6) into dev.typeparams
- test/run.go
CL 328050 added fixedbugs/issue46749.go to -G=3 excluded files list
Merge List:
+ 2021-06-16 785a8f677f cmd/compile: better error message for invalid untyped operation
+ 2021-06-16 a752bc0746 syscall: fix TestGroupCleanupUserNamespace test failure on Fedora
+ 2021-06-15 d77f4c0c5c net/http: improve some server docs
+ 2021-06-15 219fe9d547 cmd/go: ignore UTF8 BOM when reading source code
+ 2021-06-15 723f199edd cmd/link: set correct flags in .dynamic for PIE buildmode
+ 2021-06-15 4d2d89ff42 cmd/go, go/build: update docs to use //go:build syntax
+ 2021-06-15 033d885315 doc/go1.17: document go run pkg@version
+ 2021-06-15 ea8612ef42 syscall: disable c-shared test when no cgo, for windows/arm
+ 2021-06-15 abc56fd1a0 internal/bytealg: remove duplicate go:build line
+ 2021-06-15 4061d3463b syscall: rewrite handle inheritance test to use C rather than Powershell
+ 2021-06-15 cf4e3e3d3b reflect: explain why convertible or comparable types may still panic
+ 2021-06-14 7841cb14d9 doc/go1.17: assorted fixes
+ 2021-06-14 8a5a6f46dc debug/elf: don't apply DWARF relocations for ET_EXEC binaries
+ 2021-06-14 9d13f8d43e runtime: update the variable name in comment
+ 2021-06-14 0fd20ed5b6 reflect: use same conversion panic in reflect and runtime
+ 2021-06-14 6bbb0a9d4a cmd/internal/sys: mark windows/arm64 as c-shared-capable
+ 2021-06-14 d4f34f8c63 doc/go1.17: reword "results" in stack trace printing
Change-Id: I60d1f67c4d48cd4093c350fc89bd60c454d23944
Diffstat (limited to 'test/fixedbugs')
-rw-r--r-- | test/fixedbugs/issue46749.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/fixedbugs/issue46749.go b/test/fixedbugs/issue46749.go new file mode 100644 index 0000000000..63ed19795e --- /dev/null +++ b/test/fixedbugs/issue46749.go @@ -0,0 +1,37 @@ +// errorcheck + +// 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. + +package p + +var s string +var b bool +var i int +var iface interface{} + +var ( + _ = "" + b // ERROR "invalid operation.*mismatched types.*untyped string and bool" + _ = "" + i // ERROR "invalid operation.*mismatched types.*untyped string and int" + _ = "" + nil // ERROR "invalid operation.*mismatched types.*untyped string and nil" +) + +var ( + _ = s + false // ERROR "invalid operation.*mismatched types.*string and untyped bool" + _ = s + 1 // ERROR "invalid operation.*mismatched types.*string and untyped int" + _ = s + nil // ERROR "invalid operation.*mismatched types.*string and nil" +) + +var ( + _ = "" + false // ERROR "invalid operation.*mismatched types.*untyped string and untyped bool" + _ = "" + 1 // ERROR "invalid operation.*mismatched types.*untyped string and untyped int" +) + +var ( + _ = b + 1 // ERROR "invalid operation.*mismatched types.*bool and untyped int" + _ = i + false // ERROR "invalid operation.*mismatched types.*int and untyped bool" + _ = iface + 1 // ERROR "invalid operation.*mismatched types.*interface {} and int" + _ = iface + 1.0 // ERROR "invalid operation.*mismatched types.*interface {} and float64" + _ = iface + false // ERROR "invalid operation.*mismatched types.*interface {} and bool" +) |