From f782111b5d0d86fa86b90d934d29d8da8aaa76c0 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 5 May 2009 13:41:46 -0700 Subject: bug117 is fixed in 6g; now an errchk R=r DELTA=42 (20 added, 22 deleted, 0 changed) OCL=28295 CL=28295 --- test/bugs/bug117.go | 21 --------------------- test/fixedbugs/bug117.go | 25 +++++++++++++++++++++++++ test/golden.out | 6 ------ 3 files changed, 25 insertions(+), 27 deletions(-) delete mode 100644 test/bugs/bug117.go create mode 100644 test/fixedbugs/bug117.go (limited to 'test') diff --git a/test/bugs/bug117.go b/test/bugs/bug117.go deleted file mode 100644 index a18e68849..000000000 --- a/test/bugs/bug117.go +++ /dev/null @@ -1,21 +0,0 @@ -// errchk $G $D/$F.go - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main -type S struct { a int } -type PS *S -func (p *S) get() int { - return p.a -} -func fn(p PS) int { - return p.get() -} -func main() { - s := S{1}; - if s.get() != 1 { - panic() - } -} diff --git a/test/fixedbugs/bug117.go b/test/fixedbugs/bug117.go new file mode 100644 index 000000000..cc3ac34ce --- /dev/null +++ b/test/fixedbugs/bug117.go @@ -0,0 +1,25 @@ +// errchk $G $D/$F.go + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main +type S struct { a int } +type PS *S +func (p *S) get() int { + return p.a +} + +func fn(p PS) int { + // p has type PS, and PS has no methods. + // (a compiler might see that p is a pointer + // and go looking in S without noticing PS.) + return p.get() // ERROR "undefined DOT" +} +func main() { + s := S{1}; + if s.get() != 1 { + panic() + } +} diff --git a/test/golden.out b/test/golden.out index 72680adea..223aa9614 100644 --- a/test/golden.out +++ b/test/golden.out @@ -85,12 +85,6 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz =========== chan/nonblock.go PASS -=========== bugs/bug117.go -bugs/bug117.go:9: undefined DOT get on PS -bugs/bug117.go:9: illegal types for operand: RETURN - int -BUG: should compile - =========== bugs/bug132.go BUG: compilation succeeds incorrectly -- cgit v1.2.3