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

private variable hide public method #888

Closed
xushiwei opened this issue Nov 12, 2021 · 0 comments
Closed

private variable hide public method #888

xushiwei opened this issue Nov 12, 2021 · 0 comments
Labels
Milestone

Comments

@xushiwei
Copy link
Member

xushiwei commented Nov 12, 2021

The following program sample.gop triggers an unexpected result

type Game struct {
    width int
}

type Sprite struct {
    *Game
}

func (p *Sprite) Width() float64 {
    return 0
}

var monkey Sprite

println monkey.width

Expected result

Access monkey.Width(), not monkey.Game.width

Got

Access monkey.Game.width

Gop Version

v1.0.20

Additional Notes

No response

@xushiwei xushiwei added the bug label Nov 12, 2021
@xushiwei xushiwei added this to the Go+ v1.1 milestone Nov 12, 2021
@xushiwei xushiwei added this to To do in Go+ v1.1 Features Dec 1, 2021
Go+ v1.1 Features automation moved this from To do to Done Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

1 participant