@@ -99,11 +99,17 @@ omitted types are treated as dynamic.
99
99
100
100
101
101
Otherwise, the missing types are filled in with the type from the overridden or
102
- implemented method. If there are multiple overridden/implemented methods and
103
- the type to be filled in does not agree, it is an error. If there is no
104
- corresponding parameter position in the overridden method to infer from, it is
105
- treated as dynamic (e.g. overriding a one parameter method with a method that
106
- takes a second optional parameter).
102
+ implemented method. If there are multiple overridden/implemented methods, and
103
+ any two of them have non-equal types (declared or inferred) for a parameter
104
+ position which is being inferred for the overriding method, it is an error. If
105
+ there is no corresponding parameter position in the overridden method to infer
106
+ from and the signatures are compatible, it is treated as dynamic
107
+ (e.g. overriding a one parameter method with a method that takes a second
108
+ optional parameter). Note: if there is no corresponding parameter position in
109
+ the overriden method to infer from and the signatures are incompatible
110
+ (e.g. overriding a one parameter method with a method that takes a second
111
+ non-optional parameter), the inference result is not defined and tools are free
112
+ to either emit an error, or to defer the error to override checking.
107
113
108
114
109
115
### Setter return types
@@ -327,9 +333,10 @@ as the appropriate method call as defined in the spec.
327
333
disallowed here.
328
334
* The inference dependency of the identifier is itself if the identifier is
329
335
a candidate for inference. Otherwise there are no inference dependencies.
330
- * A simple identifier denoting a formal parameter which has an annotated type is
331
- an immediately evident expression and has the type with which it was
332
- annotated.
336
+ * A simple identifier denoting a formal parameter which has an annotated type
337
+ and is not a promotion candidate is an immediately evident expression and has
338
+ the type with which it was annotated.
339
+ * Note: the treatment of promotion candidates is still under discussion.
333
340
* No inference dependencies.
334
341
* A function (or function expression) invocation with no omitted generic
335
342
arguments where the applicand is an IE that has an inferred type with a
0 commit comments