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

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;
}
主站蜘蛛池模板: 大化| 永德县| 定安县| 沾化县| 大关县| 泸溪县| 平顶山市| 宁南县| 年辖:市辖区| 阿合奇县| 读书| 工布江达县| 道孚县| 新泰市| 青阳县| 乌兰浩特市| 临城县| 利川市| 二手房| 崇左市| 额尔古纳市| 潮安县| 长丰县| 米泉市| 石屏县| 西贡区| 英山县| 图片| 广平县| 右玉县| 济阳县| 榕江县| 旬邑县| 乌鲁木齐县| 阳原县| 曲阳县| 九江县| 安庆市| 石楼县| 呈贡县| 荥经县|