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

comand style parser error #1316

Closed
visualfc opened this issue Jul 3, 2022 · 0 comments · Fixed by #1318
Closed

comand style parser error #1316

visualfc opened this issue Jul 3, 2022 · 0 comments · Fixed by #1318
Labels
Milestone

Comments

@visualfc
Copy link
Member

visualfc commented Jul 3, 2022

The following program sample.gop triggers an unexpected result

// add a sample
type T struct {
	n int
}

func (t *T) Test() {
	println "call test"
}

func add(i, j int) func(x int) *T {
	println i, j
	return func(x int) *T {
		println "call", x
		return &T{x}
	}
}

add(100,200) (0).Test()

Expected result

100 200
call 0
call test

Got

main.gop:17:14: (0).Test undefined (type untyped int has no field or method Test)

Gop Version

e0f975b

Additional Notes

gop v1.1.2 build ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants