3 // Copyright 2014 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.
7 // Issue 6671: Logical operators should produce untyped bool for untyped operands.
17 b = bool(true) // ERROR "cannot use"
18 b = true // permitted as expected
19 b = bool(true) && true // ERROR "cannot use"
20 b = true && true // permitted => && returns an untyped bool
21 b = x < y // permitted => x < y returns an untyped bool
22 b = true && x < y // permitted => result of && returns untyped bool
23 b = x < y && x < y // permitted => result of && returns untyped bool
24 b = x < y || x < y // permitted => result of || returns untyped bool
25 var c bool = true && x < y // permitted => result of && is bool
26 c = false || x < y // permitted => result of || returns untyped bool