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

v3: SourceCodeGenerator throwing compile errors #281

Open
dario-zubovic opened this issue May 24, 2024 · 1 comment
Open

v3: SourceCodeGenerator throwing compile errors #281

dario-zubovic opened this issue May 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dario-zubovic
Copy link

dario-zubovic commented May 24, 2024

What is the current behavior?

YarnSpinner.Unity.SourceCodeGenerator\ActionRegistrationSourceGenerator\YarnActionRegistration-PROJECTNAME.Generated.cs(23,67): error CS1503: Argument 2: cannot convert from 'method group' to 'Delegate'

YarnSpinner.Unity.SourceCodeGenerator\ActionRegistrationSourceGenerator\YarnActionRegistration-PROJECTNAME.Generated.cs(24,73): error CS1503: Argument 2: cannot convert from 'method group' to 'Delegate'

YarnSpinner.Unity.SourceCodeGenerator\ActionRegistrationSourceGenerator\YarnActionRegistration-PROJECTNAME.Generated.cs(55,60): error CS1503: Argument 2: cannot convert from 'method group' to 'Delegate'

Please provide the steps to reproduce, and if possible a minimal demo of the problem:
Just import development/v3 branch in Unity 2022.3.22f1.

What is the expected behavior?
Generated code should compile without any errors.

Please tell us about your environment:

  • Yarn Spinner Version: development/v3 (4656e24)
  • Unity Version: 2022.3.22f1
@dario-zubovic dario-zubovic added the bug Something isn't working label May 24, 2024
@dario-zubovic
Copy link
Author

dario-zubovic commented May 24, 2024

Managed to narrow down which command is producing invalid generated code:

[YarnCommand("test")]
public static IEnumerator Test()
{
    yield return null;
}

However, these signatures produce valid code:

  • public static void Test()
  • public static IEnumerator Test(string parameter)
  • public IEnumerator Test()

So I would deduce that in order to generate broken code, method tagged with YarnCommandAttribute must:

  • be static
  • return IEnumerator
  • have no parameters

Note that methods with same signature didn't cause any issues with Yarn 2.4.

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