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

Creating a method body analyzer to analyze whole method and report issues

A stateful method body or code block analyzer registers action callbacks that require whole method body analysis to report issues about the method declaration or executable code. These analyzers generally need to initialize some mutable state at the start of the analysis, which is updated while analyzing the method body, and the final state is used to report diagnostics.

In this section, we will create a code block analyzer that flags unused method parameters. For example, it will not flag param1 and param2 as unused, but will flag param3 and param4.

void M(int param1, ref int param2, int param3, params int[] param4)
{
int local1 = param1;
param2 = 0;
}
主站蜘蛛池模板: 陇川县| 广昌县| 通山县| 南川市| 鸡东县| 五莲县| 合水县| 舟山市| 绵阳市| 区。| 湖口县| 彭州市| 油尖旺区| 高邮市| 长岛县| 株洲市| 广州市| 宁南县| 华宁县| 南雄市| 定远县| 会昌县| 溧阳市| 农安县| 罗城| 正宁县| 泸定县| 通山县| 屏东县| 祁东县| 方山县| 仁寿县| 古田县| 二手房| 宁明县| 盖州市| 满洲里市| 同仁县| 蒲江县| 阿瓦提县| 红安县|