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

does not appear to work with generics #283

Open
rcoreilly opened this issue Jun 19, 2022 · 1 comment
Open

does not appear to work with generics #283

rcoreilly opened this issue Jun 19, 2022 · 1 comment

Comments

@rcoreilly
Copy link
Member

it barfs on my generics types. :(

@linzhp
Copy link

linzhp commented Jul 23, 2023

Just ran into the same issue:

gopy build -output=zap -vm python3 go.uber.org/zap

It failed with:

ozap.go:3983:45: expected '(', found any_
zap.go:3988:37: missing ',' in type argument list
zap.go:3990:45: expected '(', found any_
zap.go:4329:31: expected '(', found any__MarshalLogObject
zap.go:4335:41: missing ',' in type argument list

Because Zap has generics, causing gopy to generate code with incorrect syntax, like:

func ptrFromHandle_zap_ObjectMarshalerPtr_T any_(h CGoHandle) zap.ObjectMarshalerPtr[T any] {
	p := gopyh.VarFromHandle((gopyh.CGoHandle)(h), "zap.ObjectMarshalerPtr[T any]")
	if p == nil {
		return nil
	}
	return p.(zap.ObjectMarshalerPtr[T any])
}
func handleFromPtr_zap_ObjectMarshalerPtr_T any_(p interface{}) CGoHandle {
	return CGoHandle(gopyh.Register("zap.ObjectMarshalerPtr[T any]", p))
}

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

No branches or pull requests

2 participants