CLSCompliant should indicate which version

You may have heard the big news that generics is now to be included in the Common Language Subset (CLS).  That’s really cool for users of VB.NET 2005 (and C# 2.0), but what if you want to know if an assembly is compliant with the earlier specification of CLSCompliant ?

Considering the actual specification is being modified then version numbers should be applied to the attribute as well.  So rather than just True/False, a string or integer or single (float) should be used. I think a float might be the most flexible, allowing easy querying of the actual CLS version. And of course, if you specify a float, the Boolean property would get set to True, so code using the old (current) CLSComplaintAttribute would continue to work.

1 Comment so far

  1.   Daniel Moth on December 23rd, 2004          

    IMO the biggest gain of generics being CLS compliant is this:

    Without CLS compliancy, some C# devs had the excuse of not applying the attribute to their assembly. Because of that, they could easily fall foul of writing case sensitive public methods e.g. void DoSth(Car car), which are unusable from VB. Now, there is no excuse 🙂