-
Notifications
You must be signed in to change notification settings - Fork 66
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
Extension properties, fields and operators #205
Comments
#114 would be easy if Extension Operators are implemented. |
#204 might be unnecessary when everything can be extended by extensions, but it should then be possible to shadow an existing method, property, etc with an extension method. |
IIRC the design for extension methods is they are not to shadow methods in the type. This is important so that importing a library with extensions doesn't hijack and change methods intrinsic to the type. Extensions extend but not break encapsulation.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: tverweij <[email protected]>
Sent: Monday, November 27, 2017 9:49:56 PM
To: dotnet/vblang
Cc: Subscribed
Subject: Re: [dotnet/vblang] Extension properties, fields and operators (#205)
#204<#204> might be unnecessary when everything can be extended by extensions, but it should then be possible to shadow an existing method, property, etc with an extension method.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#205 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AID_hFpWLx611hNYwRhJ8G3Fa42DgsTJks5s6pPUgaJpZM4Qq1ez>.
|
That's correct. You will never ever be able to shadow an instance method by using an extension method.
|
And I agree with it; as you describe, the side effects of shadowing extensions are unacceptable. |
This is a great idea, and is being discussed. Happily, this has a Roslyn proposal. If that moves forward, extending :-) it to VB should be straightforward. More recent than dotnet/roslyn#6136 is dotnet/roslyn#11159 |
A long time ago Extension Methods were added to C# and VB.
I propose to add extension properties and extension fields too.
The text was updated successfully, but these errors were encountered: