-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: print expression for invalid operation errors
For #48472 Change-Id: I5072ebcf53e03fb5515c51a2ad01f02d72b30719 Reviewed-on: https://go-review.googlesource.com/c/go/+/350929 Reviewed-by: Robert Griesemer <[email protected]> Trust: David Chase <[email protected]>
- Loading branch information
1 parent
aeea5ba
commit ff8a7e5
Showing
4 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48472.go2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 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 | ||
|
||
func g() { | ||
var s string | ||
var i int | ||
_ = s /* ERROR invalid operation: s \+ i \(mismatched types string and int\) */ + i | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 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 | ||
|
||
func g() { | ||
var s string | ||
var i int | ||
_ = s /* ERROR invalid operation: s \+ i \(mismatched types string and int\) */ + i | ||
} |