Commit Graph

12 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy fb812301b2 Add test to preserve behaviour
It's important to have ambiguity in these cases to introduce overload
 resolution by suspend-modifier without breaking changes in future

 Relates to #KT-23610
2020-06-05 14:07:08 +03:00
Mikhail Zarechenskiy 6b0a803d14 Allow suspend-conversion for callable references as part of adaptation 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy a4af833d55 Narrow down the range for compatibility warning to callee expression 2020-06-05 13:24:19 +03:00
Mikhail Zarechenskiy f073e34926 Update forgotten test-data 2020-06-01 15:35:24 +03:00
Mikhail Zarechenskiy 599f520fd8 Add compatibility warning for chained sam->suspend-conversion 2020-06-01 10:19:35 +03:00
Mikhail Zarechenskiy a5203428a4 Replace resolution error for suspend-conversion with call checker error 2020-06-01 10:19:34 +03:00
Mikhail Zarechenskiy eaeaf3c8a3 Add compatibility warning for suspend conversions 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy 8bdc4d34f7 [NI] Commonize type-conversions (SAM/Suspend)
- Allow participating subtypes of functional types in conversions
 - Fix several subtle inconsistencies
 - Place logic about conversions at one place

 Now conversions operations have two stages: before usual subtyping
 check and after one. This is needed to support conversions of
 subtypes (of functional types, for example). First, the compiler
 checks if it possible to resolve an argument without conversion and
 only then it tries to perform conversion.
 Note that it'd be incorrect to perform conversion eagerly as it can
 change resolve (Runnable & () -> Unit <: KRunnable), plus we can't
 guess whether conversion is needed at all as it's important not to
 look into supertypes if resolution doesn't actually needed it

 #KT-36448 Fixed
 #KT-37574 Fixed
 #KT-38604 Fixed
2020-05-20 15:30:14 +03:00
Denis Zharkov e1e149a062 FIR: Support coercion-to-unit semantics for callable references 2020-05-18 11:17:45 +03:00
Mikhail Zarechenskiy cb975bde7c Add test for questionable chained fun -> suspend conversion 2020-04-22 16:10:45 +03:00
Mikhail Zarechenskiy ac642cf175 Support suspend conversion in callable reference adaptation
#KT-15917 In Progress
2020-04-22 16:10:45 +03:00
Mikhail Zarechenskiy 537a59d6ca Introduce basic suspend conversion in FE
#KT-15917 In Progress
2020-04-22 16:10:44 +03:00