Skip to content

Commit 78fac02

Browse files
thanmianlancetaylor
authored andcommitted
test: add test for gccgo issue #15722
Change-Id: I4faf9a55414e217f0c48528efb13ab8fdcd9bb16 Reviewed-on: https://go-review.googlesource.com/24845 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent e14e67f commit 78fac02

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/fixedbugs/issue15722.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// errorcheck
2+
3+
// Copyright 2016 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+
// Checks to make sure that the compiler can catch a specific invalid
8+
// method type expression. NB: gccgo and gc have slightly different
9+
// error messages, hence the generic test for 'method' and not something
10+
// more specific.
11+
12+
package issue15722
13+
14+
type T int
15+
type P *T
16+
17+
func (T) t() {}
18+
19+
func _(p P) {
20+
P.t(p) // ERROR "method"
21+
}

0 commit comments

Comments
 (0)