-
Notifications
You must be signed in to change notification settings - Fork 19k
go/types: support cgo semantics #23090
Copy link
Copy link
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I was thinking about #975.
My idea is guessing argument types and making specialized wrappers.
For example,
We can convert following code
into
I'd like to leave these translations to cgo.
To promote this idea, we have to make
go/typesunderstand some special cgo semantics.C.char,C.int, ...)unsafe.Pointerin the expression context (e.g.var xxx unsafe.Pointer = C.puts)errorargument in the assignment context (e.g_, err := C.puts(C.CString("x"))Is this acceptable?
FWIW, https://go-review.googlesource.com/c/go/+/83215 is the attempt.