Skip to content

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

Merged
deadprogram merged 2 commits intotinygo-org:devfrom
jakebailey:go-version-bump
Apr 17, 2026
Merged

go.mod, compiler: bump minimum Go version to 1.23#5302
deadprogram merged 2 commits intotinygo-org:devfrom
jakebailey:go-version-bump

Conversation

@jakebailey
Copy link
Copy Markdown
Member

@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

@jakebailey
Copy link
Copy Markdown
Member Author

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

@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
@deadprogram
Copy link
Copy Markdown
Member

@jakebailey do you want to squash/rebase these commits yourself?

@jakebailey
Copy link
Copy Markdown
Member Author

Sure, I just assumed you did that with GitHub squash merge itself.

@deadprogram
Copy link
Copy Markdown
Member

Sure, I just assumed you did that with GitHub squash merge itself.

I think there are a couple atomic commits in this PR so better to not squash it all together into 1.

@jakebailey jakebailey force-pushed the go-version-bump branch 2 times, most recently from 20e566b to a00f25e Compare April 17, 2026 15:23
@jakebailey jakebailey changed the title go.mod: bump minimum Go version to 1.23 go.mod, compiler: bump minimum Go version to 1.23 Apr 17, 2026
@jakebailey
Copy link
Copy Markdown
Member Author

Rebased into two commits which should pass tests individually.

@jakebailey
Copy link
Copy Markdown
Member Author

Hm, CI fails, but I think this is a flake? I did not change the code in the PR.

Comment thread internal/tools/go.mod
Copy link
Copy Markdown
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, by dropping Go 1.22 support we add support for type aliases? If so, yeah that seems reasonable.

Comment thread testdata/typealias.go
This enables gotypesalias=1 by default, which is needed for
generic type aliases to work correctly in go/types.
@deadprogram
Copy link
Copy Markdown
Member

Thank you very much @jakebailey for the improvements and to @aykevl for helping review. Now merging.

@deadprogram deadprogram merged commit b792c10 into tinygo-org:dev Apr 17, 2026
19 checks passed
@jakebailey jakebailey deleted the go-version-bump branch April 17, 2026 18:19
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.

3 participants