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

bind: support slices as method arguments #54

Closed
phil-mansfield opened this issue Aug 31, 2015 · 3 comments
Closed

bind: support slices as method arguments #54

phil-mansfield opened this issue Aug 31, 2015 · 3 comments
Assignees
Labels

Comments

@phil-mansfield
Copy link

The package

package slice_arg

type T struct {
}

func (t T) Slice(s []float64) {
}

fails with

$ go build && gopy bind --lang=py2 .
2015/08/31 10:29:15 work: /var/folders/j0/l297p36x68dfmcrh07jptj200000gn/T/gopy-628775343
# _/private/var/folders/j0/l297p36x68dfmcrh07jptj200000gn/T/gopy-628775343
./slice_arg.go:164: cannot use s (type cgo_type_0x1114782197) as type []float64 in argument to (*slice_arg.T)(unsafe.Pointer(self)).Slice
2015/08/31 10:29:15 error dispatching command: exit status 2

The following two packages both successfully compile:

package slice_arg

type T struct {
}

func Slice(t T, s []float64) {
}
package slice_arg

type T struct {
}

func (t T) Slice(x float64) {                                            
}
@sbinet
Copy link
Member

sbinet commented Aug 31, 2015

note to self: this interesting "feature" would be fixed by really harmonizing the wrapping of methods and the wrapping of functions.
the refactorization of these 2 wrappings was somehow stopped in the middle.

@sbinet sbinet added the bug label Aug 31, 2015
@sbinet sbinet self-assigned this Aug 31, 2015
@corona10
Copy link
Collaborator

#129

Now CFFI engine supports this feature. :)

@rcoreilly
Copy link
Member

for old version, closing

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

4 participants