编译器警告(等级 2)CS1710
“类型”上的 XML 注释中有重复的“参数”typeparam 标记
泛型类型的文档包含重复的类型形参标记。
下面的代码将导致出现警告 CS1710。
// CS1710.cs
// compile with: /doc:cs1710.xml
// To resolve this warning, delete one of the duplicate <typeparam>'s.
using System;
class Stack<ItemType>
{
}
/// <typeparam name="MyType">can be an int</typeparam>
/// <typeparam name="MyType">can be an int</typeparam>
class MyStackWrapper<MyType>
{
// Open constructed type Stack<MyType>.
Stack<MyType> stack;
public MyStackWrapper(Stack<MyType> s)
{
stack = s;
}
}
class CMain
{
public static void Main()
{
// Closed constructed type Stack<int>.
Stack<int> stackInt = new Stack<int>();
MyStackWrapper<int> MyStackWrapperInt =
new MyStackWrapper<int>(stackInt);
}
}