Specifying an incorrect signature for PostDoc will silently fail in surprisng ways
grahamboree opened this issue · 0 comments
grahamboree commented
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