1// compile 2 3// Copyright 2011 The Go Authors. All rights reserved. 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 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*/ 32