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

Specifying an incorrect signature for PostDoc will silently fail in surprisng ways #51

Open
grahamboree opened this issue May 30, 2023 · 0 comments
Assignees
Labels
🐛bug Clearly not working as expected

Comments

@grahamboree
Copy link
Contributor

grahamboree commented May 30, 2023

For example:

class Sample {
  int foo = 10;
  public static void PostDoc(Sample s) {
    s.foo = 42;
  }
}

This will be registered in the reflection cache as a the post doc to call for the Sample type, but because it's a void function, when it's invoked it will always return null. This means that this line in the reification process will always generate null values from valid yaml: https://github.com/SpryFox/DarkConfig/blob/1e8c8fb5041467dbbcebc62d9f26ee87b84f5400/src/DarkConfig/Internal/TypeReifier.cs#LL449C30-L449C30

This should instead throw an error when attempting to register a PostDoc function that doesn't match the required signature

@grahamboree grahamboree added the 🐛bug Clearly not working as expected label May 30, 2023
@grahamboree grahamboree self-assigned this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Clearly not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant