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

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
{
}
}
}
主站蜘蛛池模板: 河源市| 九龙坡区| 镇巴县| 和静县| 遂溪县| 平乡县| 通城县| 陆良县| 尤溪县| 开远市| 青龙| 静海县| 桐乡市| 石首市| 商河县| 大姚县| 都匀市| 炉霍县| 新绛县| 宣化县| 炉霍县| 太康县| 奉新县| 富锦市| 海安县| 无棣县| 岳阳县| 铁力市| 麦盖提县| 开鲁县| 永顺县| 玉山县| 潞西市| 丰县| 新源县| 剑河县| 甘洛县| 天门市| 马公市| 宜宾县| 轮台县|