mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
go.mod, compiler: bump minimum Go version to 1.23
This enables gotypesalias=1 by default, which is needed for generic type aliases to work correctly in go/types.
This commit is contained in:
@@ -96,7 +96,7 @@ jobs:
|
|||||||
# This tests our lowest supported versions of Go and LLVM, to make sure at
|
# This tests our lowest supported versions of Go and LLVM, to make sure at
|
||||||
# least the smoke tests still pass.
|
# least the smoke tests still pass.
|
||||||
docker:
|
docker:
|
||||||
- image: golang:1.22-bullseye
|
- image: golang:1.23-bullseye
|
||||||
steps:
|
steps:
|
||||||
- test-linux:
|
- test-linux:
|
||||||
llvm: "15"
|
llvm: "15"
|
||||||
|
|||||||
+1
-1
@@ -540,7 +540,7 @@ func (c *compilerContext) isValidWasmType(typ types.Type, site wasmSite) bool {
|
|||||||
}
|
}
|
||||||
for i := 0; i < typ.NumFields(); i++ {
|
for i := 0; i < typ.NumFields(); i++ {
|
||||||
ftyp := typ.Field(i).Type()
|
ftyp := typ.Field(i).Type()
|
||||||
if ftyp.String() == "structs.HostLayout" {
|
if types.Unalias(ftyp).String() == "structs.HostLayout" {
|
||||||
hasHostLayout = true
|
hasHostLayout = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module github.com/tinygo-org/tinygo
|
module github.com/tinygo-org/tinygo
|
||||||
|
|
||||||
go 1.22.0
|
go 1.23
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/aykevl/go-wasm v0.0.2-0.20250317121156-42b86c494139
|
github.com/aykevl/go-wasm v0.0.2-0.20250317121156-42b86c494139
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ func TestBuild(t *testing.T) {
|
|||||||
if minor >= 23 {
|
if minor >= 23 {
|
||||||
tests = append(tests, "go1.23/")
|
tests = append(tests, "go1.23/")
|
||||||
}
|
}
|
||||||
|
if minor >= 24 {
|
||||||
|
tests = append(tests, "typealias.go")
|
||||||
|
}
|
||||||
|
|
||||||
if *testTarget != "" {
|
if *testTarget != "" {
|
||||||
// This makes it possible to run one specific test (instead of all),
|
// This makes it possible to run one specific test (instead of all),
|
||||||
|
|||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
// Generic type alias (requires go 1.24+, or GOEXPERIMENT=aliastypeparams in go 1.23).
|
||||||
|
type Set[T comparable] = map[T]struct{}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
s := make(Set[string])
|
||||||
|
s["hello"] = struct{}{}
|
||||||
|
println(len(s))
|
||||||
|
}
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
Reference in New Issue
Block a user