1// errorcheck
2
3// Copyright 2015 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
7// Issue 13821.  Additional regress tests.
8
9package p
10
11type B bool
12type B2 bool
13
14var b B
15var b2 B2
16var x1 = b && 1 < 2 // x1 has type B, not ideal bool
17var x2 = 1 < 2 && b // x2 has type B, not ideal bool
18var x3 = b && b2    // ERROR "mismatched types B and B2|incompatible types"
19var x4 = x1 && b2   // ERROR "mismatched types B and B2|incompatible types"
20var x5 = x2 && b2   // ERROR "mismatched types B and B2|incompatible types"
21var x6 = b2 && x1   // ERROR "mismatched types B2 and B|incompatible types"
22var x7 = b2 && x2   // ERROR "mismatched types B2 and B|incompatible types"
23
24var x8 = b && !B2(true) // ERROR "mismatched types B and B2|incompatible types"
25