-
Notifications
You must be signed in to change notification settings - Fork 28
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
Using GetCapturedArguments()
on a variadic function with no variadic args causes a panic
#87
Comments
GetCapturedArguments()
on a variadic function causes a panicGetCapturedArguments()
on a variadic function with no variadic args causes a panic
@jpopadak You're absolutely right, that's a bug. Thanks for troubleshooting this already. I'll see if I can fix this within the next days. |
@jpopadak Just pushed a change on |
@jpopadak Please let me know in case you still have trouble with this. Otherwise, I'll consider this fixed and will release it to |
Looks like this was fixed with 2.7.0. Thanks! :) |
Yes, those arguments make zero sense, but it works to cause the issue we are seeing in real code.
Source:
Test:
Turns out this is due to these generated lines always expecting at least 1 value passed into the variadic function:
_param1 = make([][]context.Context, len(params[1]))
The code does a length check, but does not check to see if the data inside the
params
> the number of arguments minus the number of variadic.Generated code:
The text was updated successfully, but these errors were encountered: