-
Notifications
You must be signed in to change notification settings - Fork 93
Description
There is a CLI library type ICloneable, and the CLI declares System.Array, System.Delegate, and System.String as implementing that interface. However, the C# spec does not declare any of this. OK, no problem.
The C# spec contains 18 uses of a type of the name ICloneable, all of them in (non-normative) examples. Again, OK, no problem!
However, the first use of that type (§18.5, Qualified interface member names) contains the following:
When an interface is part of a namespace, a qualified interface member name can include the namespace name.
Example:
namespace System { public interface ICloneable { object Clone(); } }Within the
Systemnamespace, bothICloneable.CloneandSystem.ICloneable.Cloneare qualified interface member names for theClonemethod.end example
The fact that this type is declared in namespace System, that supposedly sacred place for non-user-defined types, seems wrong. In any event, this section has nothing whatsoever to do with cloning, so why not remove the potential confusion that there is/might be a standard library type of this name?
(All other occurrences of this type are not used in the context of namespace System.)
How about we use instead an interface type that is required by the C# spec, as follows?
Example:
namespace System { public interface IDisposable { object Dispose(); } }Within the
Systemnamespace, bothIDisposable.DisposeandSystem.IDisposable.Disposeare qualified interface member names for theDisposemethod.end example