Another example: Generic type inference.
另一个示例:通用类型推断。
Visual Basic 10 adds type inference for initialization arrays.
VisualBasic10为数组初始化增加了类型推断。
Even with type inference, redundant type information is needed.
即使使用类型推断,还是需要多余的类型信息。
Instead, the compiler could figure it out for itself using type inference.
相反,使用类型推断,编译器可以自己处理。
In type inference, the compiler infers the types of values based on the context.
在类型推断的情况下,编译器会根据上下文推断值的类型。
Doesn't it need to do type inference at runtime?
它不需要在运行时做类型推断?
Code that USES type inference resembles code that relies on late binding.
使用类型推理的代码类似于依赖后期绑定的代码。
The type inference picks a type that works for all outcomes of the if expression.
类型推断选择了一个满足if表达式所有结果的类型。
While nice to have, type inference was not added just to make typing a bit faster.
虽然看上去不错,不过添加类型推断却不只是为了提高开发者的那么一点点输入速度。
The capture-helper trick depends on several things: type inference and capture conversion.
捕获助手技巧涉及多个因素:类型推断和捕获转换。
The compiler applies type inference logic to all generic methods that share the same name.
编译器会对共用相同名称的所有泛型方法套用型别推断逻辑。
So lambda expressions bring with them another friend - expanded type inference through target typing.
所以,lambda表达式带来了另一个相关功能,即通过目标类型化(target typing)实现的扩展类型推断。
In the overload resolution step, the compiler includes only those generic methods on which type inference succeeded.
在重载解析步骤中,编译器仅包括类型推理取得成功的那些泛型方法。
When there are no explicit type parameters, type inference is used to determine the types of parameters of functions.
没有显式类型参数时,会使用类型推理来确定函数的参数类型。
Eventually we chose the complex algorithm because it is more similar to the behavior of type inference elsewhere in the language.
最终我们选择了复杂算法,因为其更类似于语言中其他地方的类型推断行为。
I am careful to make this type inference optional, and I think it's probably dangerous to use it as a cornerstone of any processing tool chain.
我谨慎地将这种类型推断设成可选的功能,认为如果将其作为所有处理工具链条的基础可能是危险的。
Many developers who find static languages too verbose often blame static typing for the verbosity when the real problem is a lack of type inference.
许多开发者发现静态语言太过冗长,抱怨静态类型是冗长的元凶,而事实上真正的原因是缺少类型推断。
Fundamentally, type inference is a constraint-solving technique, and there are often multiple reasonable choices for which constraints to start with.
从根本上讲,类型推断是约束解决技术,往往对使用哪些约束开始具有多个合理的选择。
The diamond feature uses type inference to figure out the type parameters on the right side of the assignment, allowing the preceding example to be rewritten as
Diamond功能使用类型推断计算出赋值右侧的类型参数,并允许将前面的示例重新编写为
Capture conversion is what allows the compiler to manufacture a placeholder type name for the captured wildcard, so that type inference can infer it to be that type.
捕获转换允许编译器为已捕获的通配符产生一个占位符类型名,以便对它进行类型推断。
That decision makes the language more consistent, makes the implementation more maintainable, and offers more opportunities to take advantage of future improvements in type inference.
该决策使语言更加一致、使实现更加易于维护以及提供更多机会以便充分利用将来在类型推断中的改进。
Code written in these languages require type annotations less often than in Scala, because Scala's type inference algorithm has to support object-oriented typing as well as functional typing.
用这些语言写出的代码需要比Scala更少的类型注解,因为Scala的类型推断算法得同时支持面向对象类型和函数式类型。
Type inference is used for methods, too.
类型推断对方法也有用。
Type inference-both exact and speculative.
类型推断——包括精确和推测两种方式。
Type inference for block variables within block calls.
在块内部的块变量类型推导。
Improved Type Inference for Generic Instance Creation.
改进对通用实例创建的类型推断。
Type inference minimizes the need for explicit type information in many contexts.
类型推断使得显式的类型声明信息在大多数场合下减少到了最低。
Type inference is not allowed in cases where the variable is not assigned a value on the same line it is declared.
若是变量的声明和赋值不在同一行书写的话,编译器将不允许我们使用类型推断。
Type inference on composite keys depends on the names of the properties in the keys, and the order in which they occur.
组合键上的类型推理取决于这些键中属性的名称,以及属性的出现顺序。
Type inference on composite keys depends on the names of the properties in the keys, and the order in which they occur.
组合键上的类型推理取决于这些键中属性的名称,以及属性的出现顺序。
应用推荐