Feature Request: Extensions Suppression/Exclusion #9424
Replies: 2 comments 2 replies
-
Do you have any examples of this? It sounds absolutely terrible |
Beta Was this translation helpful? Give feedback.
-
I understand the problem here but at the same time, this feels like feedback for the library authors. They are the ones defining Not sure having a language feature here is the appropriate recourse. If we take this then should we next take a request to ban operators that have implicit conversions to / from types in the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request: Extensions Suppression/Exclusion
Summary
Request for a mechanism to suppress or exclude specific extension classes when importing a namespace, to prevent unwanted third-party extensions from polluting the current scope.
Problem Statement
Third-party libraries sometimes place extension methods in commonly-used namespaces like
System
. When developers need to import these namespaces for core types, they are forced to also import all extensions from third-party libraries, which can cause conflicts and performance issues.Growing Urgency
Since C# 14 is introducing expanded extension capabilities (properties, operators, indexers, events), the extension pollution problem will become significantly worse.
Current Problematic Scenario
Issues This Creates
Beta Was this translation helpful? Give feedback.
All reactions