From: Ian Lance Taylor Date: Wed, 5 Nov 2008 19:25:30 +0000 (-0800) Subject: Don't use a named pointer type as a receiver type. The X-Git-Tag: weekly.2009-11-06~2795 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6cd74b03f38de40d84d1d9efe8663714ccfaaee5;p=gostls13.git Don't use a named pointer type as a receiver type. The current spec forbids it: The type specified by the type name is called ``receiver base type''. The receiver base type must be a type declared in the current file, and it must not be a pointer type. R=r DELTA=2 (0 added, 0 deleted, 2 changed) OCL=18527 CL=18541 --- diff --git a/test/chan/powser1.go b/test/chan/powser1.go index 4b0aa6128e..6c57894a9b 100644 --- a/test/chan/powser1.go +++ b/test/chan/powser1.go @@ -19,13 +19,13 @@ type rat struct { type item *rat; -func (u item) pr(){ +func (u *rat) pr(){ if u.den==1 { print(u.num) } else { print(u.num, "/", u.den) } print(" ") } -func (u item) eq(c item) bool { +func (u *rat) eq(c item) bool { return u.num == c.num && u.den == c.den }