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.
你也希望根据那些特性打开新的推断特性的选项,这允许编译器通过估计右值表达式去推测出局部变量的申明类型。
Also as the name says, implicitly typed local variable, you cannot use var for field declaration or constant variables, therefore following declarations will both produce a compiler error.
故名思意,“隐式类型局部变量”将无法用于域变量或常量的声明中,否则将导致编译错误。
应用推荐