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
Currently the generated static class containing extension methods is either public or internal based on the visibility of the variant itself, but it doesn't take into consideration the visibility of the value types.
In addition to that, now that we support generic types we can end up in a scenario like the following:
publicpartialclassVariant<T1>{/* ... */}internalpartialclassVariant<T2,T2>{/* ... */}// generated code:internalstaticclassVariantEx{// Extension methods for Variant<T1> are public
...// Extension methods for Variant<T1, T2> are public
...}
Even though this is a very questionable design, users can write code like that and it should not generate a broken implementation.
To support this properly we need to determine the visibility for the extension class itself separately from the visibility of the generated extension methods. So in the above example VariantEx should be public with the extension methods for Variant<T1> generated public and for Variant<T1, T2> generated internal.
The text was updated successfully, but these errors were encountered:
Currently the generated
static class
containing extension methods is eitherpublic
orinternal
based on the visibility of the variant itself, but it doesn't take into consideration the visibility of the value types.In addition to that, now that we support generic types we can end up in a scenario like the following:
Even though this is a very questionable design, users can write code like that and it should not generate a broken implementation.
To support this properly we need to determine the visibility for the extension class itself separately from the visibility of the generated extension methods. So in the above example
VariantEx
should bepublic
with the extension methods forVariant<T1>
generatedpublic
and forVariant<T1, T2>
generatedinternal
.The text was updated successfully, but these errors were encountered: