You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
binding ObjC method with accept or return generalized types like NSArray<NEPacket *>
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
succesful bind
What did you see instead?
Method not found, which is expected.
This issue is more like feature request/discussion. Are there any plans to provide at least minimal support of generics in Obj C? There are some very nice iOS apis which expect NSArrays of concrete objects and it's sad, that we cannot bind them?
I would like to try to create a POC myself, so maybe someone else has done some investigation, have some thoughts etc?
As there is no generics concept in golang, so I see a biggest problem here is how to distinquish lets say NSArray<NEPacket *> from NSArray<NSDate *>
Current import which looks like this "Objc/Foundation/NSArray" generates golang interface NSArray with methods which are not typed (like Count) which is fine. So perhaps we can do something like
"ObjC/Foundation/NEPacket_NSArray" to generate distinct go interfaces with methods which accept or return NEPacket type parameters? I know it looks ugly, but I didn't find out any other options how to encode type name of array into interface as only to as part of interface name.
Any help, ideas, suggestions would be much appreciated
The text was updated successfully, but these errors were encountered:
And I guess we can put aside all those covariant/ contrvariant thingies at the moment. Plain and simple NSArray or any other example will be a huge start.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tadovas/work/go/openvpnv3-go-bindings"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_j/73ymsvw56v989xyfwn6q18_m0000gn/T/go-build533420179=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
binding ObjC method with accept or return generalized types like NSArray<NEPacket *>
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
succesful bind
What did you see instead?
Method not found, which is expected.
This issue is more like feature request/discussion. Are there any plans to provide at least minimal support of generics in Obj C? There are some very nice iOS apis which expect NSArrays of concrete objects and it's sad, that we cannot bind them?
I would like to try to create a POC myself, so maybe someone else has done some investigation, have some thoughts etc?
As there is no generics concept in golang, so I see a biggest problem here is how to distinquish lets say NSArray<NEPacket *> from NSArray<NSDate *>
Current import which looks like this "Objc/Foundation/NSArray" generates golang interface NSArray with methods which are not typed (like Count) which is fine. So perhaps we can do something like
"ObjC/Foundation/NEPacket_NSArray" to generate distinct go interfaces with methods which accept or return NEPacket type parameters? I know it looks ugly, but I didn't find out any other options how to encode type name of array into interface as only to as part of interface name.
Any help, ideas, suggestions would be much appreciated
The text was updated successfully, but these errors were encountered: