summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-02-18 21:07:08 -0500
committerRuss Cox <rsc@golang.org>2012-02-18 21:07:08 -0500
commit126d475a4311c5c34f380a11941dbeeac39145fd (patch)
treeaae99136bd4256166cec59f4e8a4d6bd738b5255 /test
parentad17a9c0a9e758a584f3d5992bc75fbde9512122 (diff)
downloadgo-git-126d475a4311c5c34f380a11941dbeeac39145fd.tar.gz
gc: drop ideal bool
R=golang-dev, ken2 CC=golang-dev https://golang.org/cl/5674098
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug285.go1
-rw-r--r--test/named.go4
-rw-r--r--test/named1.go4
3 files changed, 3 insertions, 6 deletions
diff --git a/test/fixedbugs/bug285.go b/test/fixedbugs/bug285.go
index 0a8a0f09e6..6b0099b8db 100644
--- a/test/fixedbugs/bug285.go
+++ b/test/fixedbugs/bug285.go
@@ -20,7 +20,6 @@ func main() {
type B bool
b := B(false)
mb := make(map[B]int)
- mb[false] = 42 // this should work: false is assignment compatible with B
mb[b] = 42
type Z int
diff --git a/test/named.go b/test/named.go
index d0330ab238..9b8e10ba22 100644
--- a/test/named.go
+++ b/test/named.go
@@ -31,7 +31,6 @@ func asString(String) {}
func (Map) M() {}
-
// These functions check at run time that the default type
// (in the absence of any implicit conversion hints)
// is the given type.
@@ -47,7 +46,7 @@ func isString(x interface{}) { _ = x.(String) }
func main() {
var (
a Array
- b Bool = true
+ b Bool = Bool(true)
c Chan = make(Chan)
f Float = 1
i Int = 1
@@ -67,7 +66,6 @@ func main() {
isBool(b)
asBool(!b)
isBool(!b)
- asBool(true)
asBool(*&b)
isBool(*&b)
asBool(Bool(true))
diff --git a/test/named1.go b/test/named1.go
index ca9da0fa31..8be7292ca9 100644
--- a/test/named1.go
+++ b/test/named1.go
@@ -26,7 +26,7 @@ type String string
func main() {
var (
- b Bool = true
+ b Bool = Bool(true)
i, j int
c = make(chan int)
m = make(Map)
@@ -34,7 +34,7 @@ func main() {
asBool(b)
asBool(!b)
- asBool(true)
+ asBool(true) // ERROR "cannot use.*type bool.*as type Bool"
asBool(*&b)
asBool(Bool(true))
asBool(1 != 2) // ERROR "cannot use.*type bool.*as type Bool"