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

  • Roslyn Cookbook
  • Manish Vasani
  • 111字
  • 2021-07-15 17:07:30

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
{
}
}
}
主站蜘蛛池模板: 伽师县| 榕江县| 图片| 垦利县| 东兰县| 临武县| 宁波市| 孙吴县| 辛集市| 青河县| 赫章县| 东乌| 荣昌县| 永春县| 泰来县| 大城县| 灵川县| 乐亭县| 桃江县| 桃园市| 宜丰县| 合水县| 左权县| 华容县| 渭源县| 锡林郭勒盟| 邯郸县| 榆林市| 阿尔山市| 齐齐哈尔市| 辉县市| 广元市| 天峨县| 无棣县| 龙门县| 乳山市| 龙州县| 郸城县| 和平县| 扶沟县| 彭泽县|