Dan Willemsen | bc60c3c | 2021-12-15 01:09:00 -0800 | [diff] [blame] | 1 | // Copyright 2021 The Go Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style | ||||
3 | // license that can be found in the LICENSE file. | ||||
4 | |||||
5 | package p | ||||
6 | |||||
7 | func g() { | ||||
8 | var s string | ||||
9 | var i int | ||||
10 | _ = s /* ERROR invalid operation: s \+ i \(mismatched types string and int\) */ + i | ||||
11 | } | ||||
12 | |||||
13 | func f(i int) int { | ||||
14 | i /* ERROR invalid operation: i \+= "1" \(mismatched types int and untyped string\) */ += "1" | ||||
15 | return i | ||||
16 | } |