You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An application `´f(e_1, ..., e_m)´` applies the expression`´f´` to the argument expressions `´e_1, ..., e_m´`.
205
-
For the overal expression to be well-typed, ´f´ must be *applicable* to its arguments, which is defined next by case analysis on ´f´'s type.
204
+
An application `´f(e_1, ..., e_m)´` applies the method`´f´` to the argument expressions `´e_1, ..., e_m´`.
205
+
For this expression to be well-typed, the method must be *applicable* to its arguments:
206
206
207
207
If ´f´ has a method type `(´p_1´:´T_1, ..., p_n´:´T_n´)´U´`, each argument expression ´e_i´ is typed with the corresponding parameter type ´T_i´ as expected type.
208
208
Let ´S_i´ be the type of argument ´e_i´ ´(i = 1, ..., m)´.
@@ -214,12 +214,12 @@ Once the types ´S_i´ have been determined, the method ´f´ of the above metho
214
214
- for every positional argument ´e_i´ the type ´S_i´ is [compatible](03-types.html#compatibility) with ´T_i´;
215
215
- if the expected type is defined, the result type ´U´ is [compatible](03-types.html#compatibility) to it.
216
216
217
-
If ´f´ is a polymorphic method, [local type inference](#local-type-inference) is used to instantiate ´f´'s type parameters.
218
-
The polymorphic method is applicable if type inference can determine type arguments so that the instantiated method is applicable.
219
-
220
-
If ´f´ has some value type, the application is taken to be equivalent to `´f´.apply(´e_1, ..., e_m´)`, i.e. the application of an `apply` method defined by ´f´.
221
-
The value `´f´` is applicable to the given arguments if `´f´.apply` is applicable.
217
+
If ´f´ is instead of some value type, the application is taken to be equivalent to `´f´.apply(´e_1, ..., e_m´)`, i.e. the application of an `apply` method defined by ´f´.
218
+
Value `´f´` is applicable to the given arguments if `´f´.apply` is applicable.
222
219
220
+
Note:
221
+
In the case where ´f´ or `´f´.apply` is a polymorphic method, this is taken as an [ommitted type application](#type-applications).
222
+
`´f´` is applicable to the given arguments if the result of this type application is applicable.
223
223
224
224
The application `´f´(´e_1, ..., e_n´)` evaluates ´f´ and then each argument ´e_1, ..., e_n´ from left to right, except for arguments that correspond to a by-name parameter (see below).
225
225
Each argument expression is converted to the type of its corresponding formal parameter.
0 commit comments