本文介绍了不正确的“未使用参考用途”在switch语句中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下switch语句产生"reference use unreached"警告7次与"开关"一致关键词。 7 - 是案例分支的数量。
The following switch statement produces "reference use unreached" warnings 7 times in line with "switch" keyword. 7 - is the number of case branches.
namespace TestApp
{
class Program
{
static void Main(string[] args)
{
if (args.Length > 0)
{
switch (args[0])
{
case "String 1": break;
case "String 2": break;
case "String 3": break;
case "String 4": break;
case "String 5": break;
case "String 6": break;
case "String 7": break;
}
}
}
}
}
推荐答案
"参考用途" "编程"是指由编译器创建的这个临时字典,"正常"字符不能达到该字典。该计划的流程。
The "reference use" refers to this temp dictionary created by the compiler, which is not reached by the "normal" flow of the program.
谢谢,
f
这篇关于不正确的“未使用参考用途”在switch语句中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!