[英]In Visual Studio 2015 readonly automatic properties can be set and it builds! Is this a bug?
此代碼
public class Entity
{
public string First { get; }
public string Last { get; }
public Entity()
{
this.First = "First name";
this.Last = "Last name";
}
}
將在VS2015中編譯,但VS2013給出錯誤“無法將屬性或索引器'ScottRickman.Entity.First'分配給它-這是只讀的”
這是VS2015中的錯誤嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.