1// errorcheck
2
3// Copyright 2009 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// Verify that method redeclarations are caught by the compiler.
8// Does not compile.
9
10package main
11
12type T struct{}
13
14func (t *T) M(int, string)  // GCCGO_ERROR "previous"
15func (t *T) M(int, float64) {} // ERROR "already declared|redefinition"
16
17func (t T) H()  // GCCGO_ERROR "previous"
18func (t *T) H() {} // ERROR "already declared|redefinition"
19
20func f(int, string)  // GCCGO_ERROR "previous"
21func f(int, float64) {} // ERROR "redeclared|redefinition"
22
23func g(a int, b string) // GCCGO_ERROR "previous"
24func g(a int, c string) // ERROR "redeclared|redefinition"
25