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

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
{
}
}
}
主站蜘蛛池模板: 华池县| 天门市| 洞口县| 泰顺县| 罗山县| 额尔古纳市| 平罗县| 沛县| 玛多县| 新密市| 三穗县| 小金县| 高雄县| 循化| 湘潭市| 扎鲁特旗| 张掖市| 安康市| 清涧县| 张家口市| 镇坪县| 循化| 临江市| 河东区| 洛南县| 汉阴县| 博客| 新泰市| 静宁县| 合山市| 凤庆县| 元江| 武川县| 辉南县| 稻城县| 靖安县| 东丰县| 黑山县| 肃宁县| 宕昌县| 洛宁县|