Since public type aliases will supposedly be more common than internal ones, it
makes sense to save on writing flags for the former rather than the latter
Previously the code was operating under the assumption that if the
implementation of some function (both the implementation and the function come
from supertypes) does not have a proper return type (the one which is a subtype
of return type of all declarations of this function in the supertypes), then
there's necessarily at least one abstract declaration of the function, such
that the implementation's return type is not a subtype of the return type of
that declaration. The assertion makes sense when the hierarchy above the
current class does not have any errors: we should report at least one function
as being "not implemented" in the current class.
However, as demonstrated by the test case, if there's an error already in the
supertypes with regard to overridability of members, this assertion may be
wrong. Reporting the "not implemented" error in such case is in fact not
necessary because of the already existing error ("return type mismatch" in the
test) in the supertypes
#KT-12482 Fixed
At first we try to resolve 'handleResult' just as last expression
in a lambda is first argument, then if results are unsuccessful
try resolve 'handleResult' with fake Unit expression
#KT-12969 Fixed
It works only for Java methods and it's purpose is Java overridability rules emulation,
namely distinction of primitive types and their wrappers.
For example `void foo(Integer x)` should not be an override for `void foo(int x)`
#KT-11440 Fixed
#KT-11389 Fixed
The main change is in
NewResolutionOldInference.ResolutionKind.CallableReference, where
createVariableProcessor creates a processor which no longer lists objects
#KT-12322 Fixed
There are two main changes here:
- In CallCompleter, there was a bug: we assumed that the return type of a
candidate must be a subtype of the expected type and were adding a
corresponding constraint to the system. However, this is not true for
callable references where the type of the expression is KFunctionN<...> and
the return type of the candidate must be a subtype of the _last generic
argument_ of the functional type.
- In CandidateResolver, we use a more correct (although still not precise)
heuristic to determine if a candidate fits based on the non-substituted type
of the callable reference expression which it would produce.
This can be further improved, see TODOs in CallCompleter. Also this does not
influence resolution of callable references being passed as arguments to
generic calls (that happens in GenericCandidateResolver)
#KT-10968 Fixed
#KT-11075 Fixed
#KT-12286 Fixed
#KT-12963 Open
#KT-12964 Open
See 4a533168d9 for the original change which
introduced the problem
Note that the added test case _was not failing_ before the change. It's added
because there were no tests on multi-file class behavior in light classes mode
at all. The actual repro for the problem is difficult to make a test from
#KT-12755 Fixed