假设我有这样一个代码:
internal abstract class Animal
{
internal bool IsExtinct { get; set; }
}
internal sealed class WoollyMammoth : Animal
{
internal int WeightLbs { get; set; }
/// <summary>
/// Construct a new instance with <see cref="IsExtinct"/> // this throws an error "XML comment has cref attribute 'IsExtinct' that could not be resolved".
/// set to "true" and <see cref="WeightLbs"/> // this works just fine.
/// initialized to 0.
/// </summary>
WoollyMammoth()
{
// no problem with either of these, of course.
IsExtinct = true;
WeightLbs = 0;
}
}
当我尝试从<see/>
XML注释标签中引用基类中定义的IsExtinct
属性时,为什么会出现错误?我可以访问派生类中定义的属性,如WeightLbs
。