blob: 9558c06ca4681dfcd1870b14dcec8d11020b3bda [file] [log] [blame]
Rémy Oudompheng2ece2f52012-02-18 22:15:42 +01001// compile
Robert Hencke883d68f2011-04-25 12:02:54 -04002
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2011 The Go Authors. All rights reserved.
Robert Hencke883d68f2011-04-25 12:02:54 -04004// 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
9package main
10
11type (
12 cplx64 complex64
13 cplx128 complex128
14)
15
16func (c cplx64) Foo() {}
17func (c cplx128) Foo() {}
18
19func main() {
20 var c64 cplx128
21 var c128 cplx64
22 c64.Foo()
23 c128.Foo()
24}
25
26/*
27bug334.go:16: invalid receiver type cplx64
28bug334.go:17: invalid receiver type cplx128
29bug334.go:22: c64.Foo undefined (type cplx128 has no field or method Foo)
30bug334.go:23: c128.Foo undefined (type cplx64 has no field or method Foo)
31*/