Local Variable Type Inference 隐含类型局部变量
You'll also want to turn on the new Option infer feature. This allows the compiler to infer local variable type declarations by evaluating the right-hand side of the expression.
你也希望根据那些特性打开新的推断特性的选项,这允许编译器通过估计右值表达式去推测出局部变量的申明类型。
Or, when editing code, type the expression first and use this refactoring to automatically create a new local variable to assign the result to.
或者,在编辑代码时,先键入此表达式并使用这种重构自动创建一个新本地变量来指定表达式的结果。
A new local variable of the same type as the method's return value is created for you.
系统将为您创建与该方法的返回值类型相同的新局部变量。
应用推荐