Skip to content

go.mod: bump minimum Go version to 1.23#5302

Open
jakebailey wants to merge 5 commits intotinygo-org:devfrom
jakebailey:go-version-bump
Open

go.mod: bump minimum Go version to 1.23#5302
jakebailey wants to merge 5 commits intotinygo-org:devfrom
jakebailey:go-version-bump

Conversation

@jakebailey
Copy link
Copy Markdown
Contributor

@jakebailey jakebailey commented Apr 14, 2026

Having go1.22 in go.mod causes gotypesalias=0 to be the default, even if the other parts of the toolchain are Go 1.23+ or higher. Bumping the minimum version resolves this, and I added a test.

In searching for docs/CI to update, I found one TODO that said it should be done in 1.23+, so, I did that too.

Related: #4894

This enables gotypesalias=1 by default, which is needed for
generic type aliases to work correctly in go/types.
@jakebailey
Copy link
Copy Markdown
Contributor Author

Hm, fun, I guess some of tinygo is not gotypesalias ready after all, and the go.mod version was masking it.

The wasmimport parameter validation checks for structs.HostLayout fields
in struct types. When HostLayout is used through a type alias (e.g.,
cm.HostLayout = structs.HostLayout), go/types reports the field type as
the alias name rather than the underlying type. Use types.Unalias to
resolve through the alias chain before comparing.
@deadprogram
Copy link
Copy Markdown
Member

Also:

go: downloading github.com/tetratelabs/wazero v1.6.0
go: downloading gopkg.in/yaml.v2 v2.4.0
no Go files in /root/project/tests/testing
--- FAIL: TestBuild (0.00s)
    --- FAIL: TestBuild/Host (0.01s)
        --- FAIL: TestBuild/Host/typealias.go (4.32s)
            main_test.go:327: # command-line-arguments
            main_test.go:327: /root/project/testdata/typealias.go:4:6: generic type alias requires GOEXPERIMENT=aliastypeparams
FAIL
exit status 1
FAIL    github.com/tinygo-org/tinygo    74.794s

@deadprogram
Copy link
Copy Markdown
Member

I would agree that we can bump the minimum version. Anyone else have any feedback before I squash/merge?

@deadprogram deadprogram added this to the 0.41.0 milestone Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants