mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
compiler: support Go 1.27 generic methods via x/tools upgrade
Go 1.27 adds generic methods (golang/go#77273). golang.org/x/tools go/ssa v0.42.0 does not instantiate them: objectMethod only applies receiverTypeArgs and ignores method-level type parameters, so a call such as (*math/rand/v2.Rand).N resolves to the abstract generic method and its body reaches createConst with a type-parameter-typed zero constant, triggering "panic: expected nil interface constant". Upgrade golang.org/x/tools to v0.47.0, whose go/ssa returns nil from MethodValue for generic methods and instantiates method-level type parameters. No compiler changes are required. Since x/tools v0.47.0 requires Go 1.25, raise the minimum supported Go version from 1.24 to 1.25. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
||||
env:
|
||||
# Oldest versions currently supported by TinyGo
|
||||
LLVM: "15"
|
||||
Go: "1.24" # when updating this, also update minorMin in builder/config.go
|
||||
Go: "1.25" # when updating this, also update minorMin in builder/config.go
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
Reference in New Issue
Block a user