Rémy Oudompheng | 2ece2f5 | 2012-02-18 22:15:42 +0100 | [diff] [blame] | 1 | // compile |
Robert Hencke | 883d68f | 2011-04-25 12:02:54 -0400 | [diff] [blame] | 2 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 3 | // Copyright 2011 The Go Authors. All rights reserved. |
Robert Hencke | 883d68f | 2011-04-25 12:02:54 -0400 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | // Issue 1716 |
| 8 | |
| 9 | package main |
| 10 | |
| 11 | type ( |
| 12 | cplx64 complex64 |
| 13 | cplx128 complex128 |
| 14 | ) |
| 15 | |
| 16 | func (c cplx64) Foo() {} |
| 17 | func (c cplx128) Foo() {} |
| 18 | |
| 19 | func main() { |
| 20 | var c64 cplx128 |
| 21 | var c128 cplx64 |
| 22 | c64.Foo() |
| 23 | c128.Foo() |
| 24 | } |
| 25 | |
| 26 | /* |
| 27 | bug334.go:16: invalid receiver type cplx64 |
| 28 | bug334.go:17: invalid receiver type cplx128 |
| 29 | bug334.go:22: c64.Foo undefined (type cplx128 has no field or method Foo) |
| 30 | bug334.go:23: c128.Foo undefined (type cplx64 has no field or method Foo) |
| 31 | */ |