mirror of
https://github.com/golang/go
synced 2024-11-22 06:04:39 -07:00
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
This commit is contained in:
parent
44a82746a1
commit
6cd74b03f3
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user