diff options
| author | Russ Cox <rsc@golang.org> | 2009-08-07 13:23:09 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-08-07 13:23:09 -0700 |
| commit | 0548edec1d65ef1cd09cc6004bab4a48b8a5cd41 (patch) | |
| tree | 137271e219ec478387784bd51d239afaa37a4ed9 /test/fixedbugs/bug183.go | |
| parent | c4ad14412d7dec2c339ad0e0ebda9eca6c0c1b16 (diff) | |
| download | golang-0548edec1d65ef1cd09cc6004bab4a48b8a5cd41.tar.gz | |
bug183 - embedded vs non-embedded struct field in eqtype
R=ken
OCL=32888
CL=32888
Diffstat (limited to 'test/fixedbugs/bug183.go')
| -rw-r--r-- | test/fixedbugs/bug183.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/fixedbugs/bug183.go b/test/fixedbugs/bug183.go new file mode 100644 index 000000000..5c3ef4934 --- /dev/null +++ b/test/fixedbugs/bug183.go @@ -0,0 +1,25 @@ +//errchk $G $D/$F.go + +// Copyright 2009 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 + +type T int + +func f() { + var x struct { T }; + var y struct { T T }; + x = y // ERROR "cannot" +} + +type T1 struct { T } +type T2 struct { T T } + +func g() { + var x T1; + var y T2; + x = y // ERROR "cannot" +} + |
