1// errorcheck -e 2 3// Copyright 2021 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7package p 8 9type T struct{} 10 11var s string 12var b bool 13var i int 14var t T 15var a [1]int 16 17var ( 18 _ = s == nil // ERROR "invalid operation:.*mismatched types string and (untyped )?nil" 19 _ = b == nil // ERROR "invalid operation:.*mismatched types bool and (untyped )?nil" 20 _ = i == nil // ERROR "invalid operation:.*mismatched types int and (untyped )?nil" 21 _ = t == nil // ERROR "invalid operation:.*mismatched types T and (untyped )?nil" 22 _ = a == nil // ERROR "invalid operation:.*mismatched types \[1\]int and (untyped )?nil" 23) 24