Skip to content
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

Is ParamDictionaryAttribute in the right namespace? #245

Open
BCSharp opened this issue Nov 1, 2020 · 1 comment
Open

Is ParamDictionaryAttribute in the right namespace? #245

BCSharp opened this issue Nov 1, 2020 · 1 comment

Comments

@BCSharp
Copy link
Member

BCSharp commented Nov 1, 2020

ParamDictionaryAttribute is declared in namespace Microsoft.Scripting. However the file in which this class is defined, is Src/Microsoft.Scripting/Runtime/ParamDictionaryAttribute.cs. All other attribute classes are defined in namespaces that match their location in the directory structure (although it is not true in a general case: Src/Microsoft.Scripting/Runtime contains a few other classes that are defined in Microsoft.Scripting).

Looking at other attributes, all of them but two are defined in Microsoft.Scripting.Runtime. It seems to me that ParamDictionaryAttribute conceptually belongs to the same group. And unlike some other "misplaced" types, it is used in many places, so for instance code that uses [ParamDictionary, NotNull] has to open two namespaces.

Should ParamDictionaryAttribute be moved to namespace Microsoft.Scripting.Runtime? Can it be done without causing a breaking change?

Or maybe the .cs file should be moved one directory up? Do we care?

And in general, what are the rules of matching namespaces to directories, if any?

@slozier
Copy link
Contributor

slozier commented Nov 1, 2020

I'm not aware of any mechanism that allows moving a type from one namespace to another without it being a breaking change (see .NET Core guidelines https://docs.microsoft.com/en-us/dotnet/core/compatibility/). Although we obviously don't need to be as strict as the BCL, I'm very reluctant to do this type of change to the DLR (whereas with ipy3 anything is fair game since it hasn't been released).

I would go with the standard .NET convention of matching the folder to the namespace. So that would mean moving it up one directory would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants