mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 13:03:39 +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:
+1
-1
@@ -25,7 +25,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
|
||||
}
|
||||
|
||||
// Version range supported by TinyGo.
|
||||
const minorMin = 24 // when updating the min version, also update .github/workflows/compat.yml
|
||||
const minorMin = 25 // when updating the min version, also update .github/workflows/compat.yml
|
||||
const minorMax = 27
|
||||
|
||||
// Check that we support this Go toolchain version.
|
||||
|
||||
Reference in New Issue
Block a user