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
ReactiveCollection should be CLS compilant (partial patch attached) #40
Comments
What is the practical benefit to being CLSCompliant (i.e. what scenarios are currently impossible but are now enabled with this?) |
If the library is CLS compilant you can be sure that it is usable by all .NET languages such as VB, F# etc (in short being CLS compilant set some constraints on the naming externally accessible (public/protected) functions and variables). In this specific instance protected members variables starts with underscore which is not possible all .Net compatible languages. |
Which languages don't support this? Removing protected member variables that start with underscore is a breaking change. |
Regarding which languages don't support leading underscore I have seen some examples earlier but right now I can only come up with C++ where leading underscore is reserved. I would still argue for at least putting CLSCompilant(true) at the assembly level so that other isssues such as names that differ only by case (which won't work with VB) is not introduced. To preserve backwardscompability you could do a rename on the variables and then create propteries. Ex: [Obsolete("use Changed instead")] |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Adding "[assembly: CLSCompliant(true)]" to the Reactive UI results in an number of varnings about ReactiveCollection not beeing CLS compilat. The varnings are attached below and can easily be resolved.
1; Add [assembly: CLSCompliant(true)] to the AssemblyInfo.cs for all the projects
2; Update ReactiveCollection to become CLS compatible.
A patch is provided changing the offending member variables from protected to private,
it they really should be protected then they should instead be renamed (ex _ItemsAdded can be renamed to itemsAdded)
------------------------------------------------------ Varnings ------------------------------------------------------
ReactiveUI\ReactiveUI\ReactiveCollection.cs(157,34): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._ItemsAdded' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(169,31): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._BeforeItemsAdded' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(179,34): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._ItemsRemoved' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(190,31): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._BeforeItemsRemoved' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(204,36): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._CollectionCountChanging' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(215,36): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._CollectionCountChanged' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(226,56): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._ItemChanging' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(241,56): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._ItemChanged' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(255,64): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._Changing' is not CLS-compliant
ReactiveUI\ReactiveUI\ReactiveCollection.cs(266,64): warning CS3008: Identifier 'ReactiveUI.ReactiveCollection._Changed' is not CLS-compliant
------------------------------------------------------ Patch begin ------------------------------------------------------
Index: ReactiveCollection.cs
--- ReactiveCollection.cs (revision 378)
+++ ReactiveCollection.cs (working copy)
@@ -154,7 +154,7 @@
}
@@ -166,7 +166,7 @@
}
@@ -176,7 +176,7 @@
}
@@ -187,7 +187,7 @@
}
@@ -198,10 +198,10 @@
}
@@ -212,7 +212,7 @@
}
@@ -223,7 +223,7 @@
}
@@ -238,7 +238,7 @@
}
@@ -252,7 +252,7 @@
}
@@ -263,7 +263,7 @@
}
------------------------------------------------------ Patch end ------------------------------------------------------
The text was updated successfully, but these errors were encountered: