Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reflect/type: reflect.FuncOf does not support more than 50 arguments #54669

Closed
super-harsh opened this issue Aug 25, 2022 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@super-harsh
Copy link

super-harsh commented Aug 25, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18.3 darwin/arm64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/harsh/Library/Caches/go-build"
GOENV="/Users/harsh/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/harsh/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/harsh/go"
GOPRIVATE=""
GOPROXY=""
GOROOT="/opt/homebrew/Cellar/go/1.18.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.3/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mm/ky8h1xr924z0y0rmk45zwr3m0000gn/T/go-build872986808=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://go.dev/play/p/uiJRuATUUE6

What did you expect to see?

Should allow up to 128 function args as per funcTypeFixed128.

What did you see instead?

Panic here with error below
reflect.FuncOf does not support more than 50 arguments

@robpike
Copy link
Contributor

robpike commented Aug 25, 2022

Seems like a feature, not a bug. :)

@theunrepentantgeek
Copy link

Under normal circumstances, I'd completely agree with you, and I think @super-harsh would as well. (I work on the same team.)

In our project, we are generating go structs based on API definitions that are outside our control.

When we use gopter to test these structs, it panics - seemingly due to the inconsistency @super-harsh has identified:
Why have specific support for 65-128 arguments (line 2055) only to panic a few lines later (line 2080) for any count over 50?

@mdempsky
Copy link
Contributor

That len(args) > 50 check does seem spurious.

@mdempsky mdempsky added Suggested Issues that may be good for new contributors looking for work to do. NeedsFix The path to resolution is known, but the work has not been done. labels Aug 25, 2022
@mdempsky mdempsky added this to the Backlog milestone Aug 25, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/425461 mentions this issue: reflect: FuncOf support more than 50 arguments

rajbarik pushed a commit to rajbarik/go that referenced this issue Sep 1, 2022

Verified

This commit was signed with the committer’s verified signature.
myitcv Paul Jolly
Fixes golang#54669

Change-Id: I34cbe729d187437ddeafbaa910af6ed001b2603f
Reviewed-on: https://go-review.googlesource.com/c/go/+/425461
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
@golang golang locked and limited conversation to collaborators Aug 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants