Skip to content

x/mobile: support for go/types.Aliases #70698

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

Open
timothy-king opened this issue Dec 5, 2024 · 2 comments
Open

x/mobile: support for go/types.Aliases #70698

timothy-king opened this issue Dec 5, 2024 · 2 comments
Labels
help wanted mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@timothy-king
Copy link
Contributor

timothy-king commented Dec 5, 2024

The main packages cmd/{gobind,gomobile} need to be updated to set gotypesalias=1 GODEBUG value by default when built by a toolchains >= 1.24. Otherwise they will not be able to type check inputs with type parameterized aliases (1.24). This can be done by conditionally setting the variable (see https://go.dev/cl/627715 for an example). Or updated the go.mod to go language setting to >= 1.23.

golang.org/x/mobile/bind may need to by updated to support go/types.Alias being produced by the type checker. Given that this calls go/types.Underlying(), it likely needs to be updated. Alternatively this could be audited by an expert on the package to determine if this is not necessary.

See #69772 for additional context.

CC @hyangah

@timothy-king timothy-king added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 5, 2024
@timothy-king timothy-king added this to the Go1.24 milestone Dec 5, 2024
@mknyszek mknyszek changed the title golang.org/x/mobile: support for go/types.Aliases x/mobile: support for go/types.Aliases Dec 5, 2024
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Dec 5, 2024
@gopherbot gopherbot modified the milestones: Go1.24, Go1.25 Feb 11, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/649381 mentions this issue: bind: pin go/types to not produce types.Alias types

@dmitshur dmitshur modified the milestones: Go1.25, Unreleased Feb 16, 2025
gopherbot pushed a commit to golang/mobile that referenced this issue Feb 18, 2025
Bind currently targets the earlier go/types semantics (gotypesalias=0),
and needs to be updated to be compatible with the new (gotypesalias=1).

This is the only way in which the module isn't compatible with Go 1.23
language semantics, so add an explicit godebug line for it with a TODO.
This unblocks moving the module to Go 1.23 (as done in the next CL).

For golang/go#70698.

Change-Id: I59a61defdcf327aed9ccd67b123b1516cd118d9e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649381
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
hajimehoshi pushed a commit to ebitengine/gomobile that referenced this issue Mar 29, 2025
Bind currently targets the earlier go/types semantics (gotypesalias=0),
and needs to be updated to be compatible with the new (gotypesalias=1).

This is the only way in which the module isn't compatible with Go 1.23
language semantics, so add an explicit godebug line for it with a TODO.
This unblocks moving the module to Go 1.23 (as done in the next CL).

For golang/go#70698.

Change-Id: I59a61defdcf327aed9ccd67b123b1516cd118d9e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/649381
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants