diff --git a/.circleci/config.yml b/.circleci/config.yml index 01a694b89..1c54b623a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,7 +96,7 @@ jobs: # This tests our lowest supported versions of Go and LLVM, to make sure at # least the smoke tests still pass. docker: - - image: golang:1.22-bullseye + - image: golang:1.23-bullseye steps: - test-linux: llvm: "15" diff --git a/compiler/symbol.go b/compiler/symbol.go index e50eba599..4f24ddbfc 100644 --- a/compiler/symbol.go +++ b/compiler/symbol.go @@ -540,7 +540,7 @@ func (c *compilerContext) isValidWasmType(typ types.Type, site wasmSite) bool { } for i := 0; i < typ.NumFields(); i++ { ftyp := typ.Field(i).Type() - if ftyp.String() == "structs.HostLayout" { + if types.Unalias(ftyp).String() == "structs.HostLayout" { hasHostLayout = true continue } diff --git a/go.mod b/go.mod index d18a92d9b..6c91603a0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/tinygo-org/tinygo -go 1.22.0 +go 1.23 require ( github.com/aykevl/go-wasm v0.0.2-0.20250317121156-42b86c494139 diff --git a/main_test.go b/main_test.go index 45290bac6..994d6a7a1 100644 --- a/main_test.go +++ b/main_test.go @@ -107,6 +107,9 @@ func TestBuild(t *testing.T) { if minor >= 23 { tests = append(tests, "go1.23/") } + if minor >= 24 { + tests = append(tests, "typealias.go") + } if *testTarget != "" { // This makes it possible to run one specific test (instead of all), diff --git a/testdata/typealias.go b/testdata/typealias.go new file mode 100644 index 000000000..27a5c331a --- /dev/null +++ b/testdata/typealias.go @@ -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)) +} diff --git a/testdata/typealias.txt b/testdata/typealias.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/testdata/typealias.txt @@ -0,0 +1 @@ +1