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

False negative error Function X expects 0 parameters, but received 1 when using Unity's runner.AddFunction<...> #48

Open
fmoo opened this issue Feb 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fmoo
Copy link

fmoo commented Feb 19, 2024

What is the current behavior?

When defining custom functions in Unity, that take an instance method or lambda, the vscode extension seems to parse these as having 0 expected arguments instead of what is in the typehint(s).

Please provide the steps to reproduce, and if possible a minimal demo of the problem:

Register a 1-argument custom function using the following:

runner.AddFunction<string, string>("test1", s => s);

or a more roundabout:

var scopedCommands = new RunnerScoped(runner);
runner.AddFunction<string, string>("test1", scopedCommands.Test1);

Then in yarn:

<<if test1("foo") == "foo">>
  // something
<<endif>>

Observe the error in the Problem panel:

Function test1 expects 0 parameters, but received 1

The behavior previously worked in vscode extension version 2.2.114 and produces the error in 2.2.115 through 2.4.4

What is the expected behavior?

No error is observed in the Problems panel

Please tell us about your environment:

  • Yarn Spinner Version: 2.3
  • Extension Version: 2.4.4
  • Unity Version: 2021.3.25f1

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant