Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto property: mixed name #1194

Closed
xushiwei opened this issue May 19, 2022 · 0 comments
Closed

auto property: mixed name #1194

xushiwei opened this issue May 19, 2022 · 0 comments
Labels
Milestone

Comments

@xushiwei
Copy link
Member

The following program sample.gop triggers an unexpected result

type Point struct {
	Min, Max int
}

type Obj struct {
	bbox Point
}

func (o *Obj) Bbox() Point {
	return o.bbox
}

func (o *Obj) Points() [2]int{
	return [2]int{o.bbox.Min, o.bbox.Max}
}

Expected result

package main

type Point struct {
	Min int
	Max int
}
type Obj struct {
	bbox Point
}

func (o *Obj) Bbox() Point {
	return o.bbox
}
func (o *Obj) Points() [2]int {
	return [2]int{o.bbox.Min, o.bbox.Max}
}

Got

mixed o.bbox with o.Bbox()

Gop Version

gop v1.1.0-alpha1-256-gf3285c6 darwin/amd64

Additional Notes

No response

xushiwei added a commit to xushiwei/gop that referenced this issue May 19, 2022
@xushiwei xushiwei added the bug label May 19, 2022
@xushiwei xushiwei added this to the Go+ v1.1 milestone May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant