Static Type Inference Sather - A Language Tutorial Prev Chapter 2. Classes and Objects Next 2.7. For the sake of convenience, Sather provides a mechanism for statically inferring the type of a variable from the context. This type-inference takes place in different situations, where the type is available from the context. In a creation expression, it is tedious to have to repeat the type of a class on both sides of a creation expression and assignment.
Type inference can also take place in a declaration, if it is combined with an assignment.
Since the declared type of the right hand side of the assignment is known, its type is used as the type of the variable. This combination of declaration and assignment is extremely common in Sather code. Arguments to a function call The type of the arguments to a function call are also known and can be used to infer the type of a creation expression in a call to the function.