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

overload in classfile can't run #1874

Closed
luoliwoshang opened this issue May 15, 2024 · 0 comments
Closed

overload in classfile can't run #1874

luoliwoshang opened this issue May 15, 2024 · 0 comments
Labels

Comments

@luoliwoshang
Copy link
Contributor

luoliwoshang commented May 15, 2024

Is it expected that the overloaded function defined in classfile is not recognized as overload

over.gox

func addString(a, b string) string {
	return a + b
}

func add = (
	func(a, b int) int {
		return a + b
	}
	addString
)

main.gop

ov := &over{}
println ov.add__0(1, 1) // 2
println ov.addString("1", "1") // 11

// println ov.add(1, 1) // got error

Expected result

2
11
2

Got

$ gop run .
main.gop:5:9: ov.add undefined (type *over has no field or method add)

===> errors stack:
gop.LoadDir(".", 0x140000a35e0, false)
        /Users/zhangzhiyang/Documents/Code/goplus/gop/gengo.go:169 LoadDir(dir, conf, genTestPkg)
gop.GenGo(".", 0x140000a35e0, false)
        /Users/zhangzhiyang/Documents/Code/goplus/gop/build_install_run.go:142 GenGo(dir, conf, false)

Gop Version

v1.2.x

Additional Notes

No response

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

2 participants