在类型推断的情况下,编译器会根据上下文推断值的类型。
In type inference, the compiler infers the types of values based on the context.
对于向上转换运算符,如果编译器无法根据上下文推断出特定的目标类型,则将报告错误。
As for the upcast operator, if the compiler cannot infer a specific target type from the context, it reports an error.
在使用向上转换运算符时,编译器会尝试根据上下文来推断出要转换为的类型。
When you use the upcast operator, the compiler attempts to infer the type you are converting to from the context.
下面的表达式指定按层次结构向下转换为一个根据程序上下文推断出的类型。
The following expression specifies a conversion down the hierarchy to a type that is inferred from program context.
下面的表达式指定按层次结构向下转换为一个根据程序上下文推断出的类型。
The following expression specifies a conversion down the hierarchy to a type that is inferred from program context.
应用推荐