summaryrefslogtreecommitdiff
path: root/test/bugs
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-06-08 15:51:31 -0700
committerRuss Cox <rsc@golang.org>2010-06-08 15:51:31 -0700
commit44b352f75b49e448f5116fe84222d0bda015dfa0 (patch)
tree6463f143fb8176a55ba86805e6a4c93356aa9171 /test/bugs
parent6574f7d387f6d8e823d4f09685bc9e27a4a6e6f6 (diff)
downloadgo-44b352f75b49e448f5116fe84222d0bda015dfa0.tar.gz
bug284: make conversion legal, fix error patterns
R=gri CC=golang-dev http://codereview.appspot.com/1612041
Diffstat (limited to 'test/bugs')
-rw-r--r--test/bugs/bug284.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/bugs/bug284.go b/test/bugs/bug284.go
index b9edc3176..9e9949bed 100644
--- a/test/bugs/bug284.go
+++ b/test/bugs/bug284.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errchk $G -e $D/$F.go
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -85,11 +85,15 @@ func main() {
}
var q1 Q1
var q2 Q2
+ var ps1 *S1
q0 = q0
q0 = q1
q0 = (*struct {
x int
- })(q2) // legal because of special conversion exception for pointers
+ })(ps1) // legal because of special conversion exception for pointers
+ q0 = (*struct {
+ x int
+ })(q2) // ERROR "cannot"
q1 = q0
q1 = q1
q1 = Q1(q2) // ERROR "cannot"
@@ -127,12 +131,12 @@ func main() {
x0 = x1
x0 = interface {
f() int
- }(x2) // ERROR "cannot"|"need type assertion"
+ }(x2) // ERROR "cannot|need type assertion"
x1 = x0
x1 = x1
- x1 = X1(x2) // ERROR "cannot"|"need type assertion"
- x2 = X2(x0) // ERROR "cannot"|"need type assertion"
- x2 = X2(x1) // ERROR "cannot"|"need type assertion"
+ x1 = X1(x2) // ERROR "cannot|need type assertion"
+ x2 = X2(x0) // ERROR "cannot|need type assertion"
+ x2 = X2(x1) // ERROR "cannot|need type assertion"
x2 = x2
type L1 []int