You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There may be cases where a user wants to use DarkConfig on a type that already has static methods named PostDoc or FromDoc. This would cause issues with DarkConfig's method name reflection-based search, and would require the client code to rename the existing methods to avoid a conflict. This is significantly less likely if we're checking the argument types, since one argument type must be DarkConfig.DocNode, but it's still possible.
Instead, the more canonical approach is likely to mark those special functions with annotations:
class Sample {
int foo = 42;
[DarkConfig.PostDoc]
public static Sample PostDoc(Sample sample) {
sample.foo = 99;
return sample;
}
[DarkConfig.FromDoc]
public static Sample FromDoc(Sample sample, DarkConfig.DocNode doc) {
return new Sample { foo = doc.As<int>(); };
}
}
The text was updated successfully, but these errors were encountered:
There may be cases where a user wants to use DarkConfig on a type that already has static methods named
PostDoc
orFromDoc
. This would cause issues with DarkConfig's method name reflection-based search, and would require the client code to rename the existing methods to avoid a conflict. This is significantly less likely if we're checking the argument types, since one argument type must beDarkConfig.DocNode
, but it's still possible.Instead, the more canonical approach is likely to mark those special functions with annotations:
The text was updated successfully, but these errors were encountered: