Skip to content

Fix receivers defined on cgo type aliases#517

Closed
masih wants to merge 1 commit intomasterfrom
masih/fix-receiver-cgo
Closed

Fix receivers defined on cgo type aliases#517
masih wants to merge 1 commit intomasterfrom
masih/fix-receiver-cgo

Conversation

@masih
Copy link
Copy Markdown
Member

@masih masih commented Feb 18, 2025

As of Go 1.24, the compiler will now always fail if receivers are defined on cgo-generated type aliases. Fix the issue by wrapping the cgo-generated types and access to underlying type via delegate field. Note that such types cannot be embedded in go structs. Hence, the explicit field.

See:

As of Go 1.24, the compiler will now always fail if receivers are
defined on cgo-generated type aliases. Fix the issue by wrapping the
cgo-generated types and access to underlying type via `delegate` field.
Note that such types cannot be embedded in go structs. Hence, the
explicit field.

See:
 * https://tip.golang.org/doc/go1.24#compiler
@masih masih force-pushed the masih/fix-receiver-cgo branch from dc3e71e to 679f917 Compare February 19, 2025 11:48
@masih masih marked this pull request as ready for review February 19, 2025 12:14
@Stebalien
Copy link
Copy Markdown
Member

This adds a lot of pointer indirection and that makes me a bit nervous. How about something like #518?

@masih
Copy link
Copy Markdown
Member Author

masih commented Feb 24, 2025

How about something like #518?

That works too 👍

@masih masih closed this Feb 24, 2025
@masih masih deleted the masih/fix-receiver-cgo branch February 24, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ☑️ Done (Archive)

Development

Successfully merging this pull request may close these issues.

2 participants