summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorR?my Oudompheng <oudomphe@phare.normalesup.org>2013-08-27 21:18:32 +0200
committerR?my Oudompheng <oudomphe@phare.normalesup.org>2013-08-27 21:18:32 +0200
commite63e34efffbbebd99c12ed594b312f1ab6c02647 (patch)
treeb3532bcbd24261c36ad85bf99b80000d916e2cd5 /test
parent8782c04e33d70e0c98c9bbda30d92128192e3fdf (diff)
downloadgo-e63e34efffbbebd99c12ed594b312f1ab6c02647.tar.gz
cmd/gc: tag builtin error, byte, rune to avoid exporting them.
Fixes issue 5910. Fixes issue 6260. R=golang-dev, daniel.morsing CC=golang-dev https://codereview.appspot.com/13257044
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug460.dir/a.go4
-rw-r--r--test/fixedbugs/bug460.dir/b.go7
-rw-r--r--test/fixedbugs/issue5910.dir/a.go9
-rw-r--r--test/fixedbugs/issue5910.dir/main.go4
4 files changed, 20 insertions, 4 deletions
diff --git a/test/fixedbugs/bug460.dir/a.go b/test/fixedbugs/bug460.dir/a.go
index 02a287b31..29049d9aa 100644
--- a/test/fixedbugs/bug460.dir/a.go
+++ b/test/fixedbugs/bug460.dir/a.go
@@ -6,4 +6,8 @@ package a
type Foo struct {
int
+ int8
+ error
+ rune
+ byte
}
diff --git a/test/fixedbugs/bug460.dir/b.go b/test/fixedbugs/bug460.dir/b.go
index 1868afe07..5c0a0c47e 100644
--- a/test/fixedbugs/bug460.dir/b.go
+++ b/test/fixedbugs/bug460.dir/b.go
@@ -9,6 +9,9 @@ import "./a"
var x a.Foo
func main() {
- x.int = 20 // ERROR "unexported field"
+ x.int = 20 // ERROR "unexported field"
+ x.int8 = 20 // ERROR "unexported field"
+ x.error = nil // ERROR "unexported field"
+ x.rune = 'a' // ERROR "unexported field"
+ x.byte = 20 // ERROR "unexported field"
}
-
diff --git a/test/fixedbugs/issue5910.dir/a.go b/test/fixedbugs/issue5910.dir/a.go
index ea223917b..b236c15c7 100644
--- a/test/fixedbugs/issue5910.dir/a.go
+++ b/test/fixedbugs/issue5910.dir/a.go
@@ -1,3 +1,7 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
package a
type Package struct {
@@ -7,11 +11,12 @@ type Package struct {
type Future struct {
result chan struct {
*Package
+ error
}
}
-func (t *Future) Result() *Package {
+func (t *Future) Result() (*Package, error) {
result := <-t.result
t.result <- result
- return result.Package
+ return result.Package, result.error
}
diff --git a/test/fixedbugs/issue5910.dir/main.go b/test/fixedbugs/issue5910.dir/main.go
index 619638195..c5d42ea09 100644
--- a/test/fixedbugs/issue5910.dir/main.go
+++ b/test/fixedbugs/issue5910.dir/main.go
@@ -1,3 +1,7 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
package main
import "a"