官术网_书友最值得收藏!

Creating a symbol analyzer to report issues about symbol declarations

A symbol analyzer registers action callbacks to analyze one or more kinds of symbol declarations, such as types, methods, fields, properties, events, and so on, reports semantic issues about declarations.

In this section, we will create a symbol analyzer that extends the compiler diagnostic CS0542 (member names cannot be the same as their enclosing type) to report a diagnostic if member names are the same as any of the outer parent type. For example, the analyzer will report a diagnostic for the innermost type NestedClass here:

public class NestedClass
{
public class InnerClass
{
public class NestedClass
{
}
}
}
主站蜘蛛池模板: 山阳县| 汕头市| 连平县| 化德县| 互助| 林周县| 南昌县| 古浪县| 广丰县| 寿阳县| 金华市| 大竹县| 汾西县| 蕲春县| 绵阳市| 潞西市| 黄龙县| 晋城| 长葛市| 松溪县| 文成县| 香格里拉县| 马鞍山市| 分宜县| 阜城县| 迭部县| 建水县| 康马县| 星座| 清河县| 濮阳市| 洱源县| 商南县| 邢台市| 北安市| 会同县| 莒南县| 合肥市| 婺源县| 广灵县| 九龙城区|