-
Notifications
You must be signed in to change notification settings - Fork 36
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
Do not generate TextAlignment extension if it's already generated by base type #205
Do not generate TextAlignment extension if it's already generated by base type #205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new Derived().M();
public class Base
{
}
public class Derived : Base
{
}
public static class Extensions1
{
public static void M<T>(this T b) where T : Base { }
}
public static class Extensions2
{
public static void M<T>(this T b) where T : Derived { }
}
@pictos Currently, we generate two generic extensions like these. The fact that they are generic is why the compiler actually complains.
If we generate it like this:
new Derived().M();
public class Base
{
}
public class Derived : Base
{
}
public static class Extensions1
{
public static void M(this Base b) { }
}
public static class Extensions2
{
public static void M(this Derived b) { }
}
It will compile just fine.
Is it possible that we switch to the non-generic approach?
@Youssef1313 here's some context around the usage of generics |
Ok, I think we can go with this approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Youssef1313!!
Apologies for not merging this sooner 🙌
Another suggested fix: #206(ONLY ONE of the PRs need to be merged)Description of Change
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information