Commit Graph

21 Commits

Author SHA1 Message Date
Mikhail Glukhikh 4b823eca21 Fix test data (FIR_IDENTICAL) 2021-01-29 16:54:17 +03:00
Dmitriy Novozhilov 299272fa6d [Test] Update diagnostics testdata according to allowed suspend fun interfaces 2021-01-28 13:19:33 +03:00
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Jinseong Jeon 5fdd06676f FIR: discriminate candidates with suspend conversion 2020-09-10 11:31:24 +03:00
Jinseong Jeon 6de8ba40c1 FIR: initial support of suspend conversion on arguments 2020-09-10 11:31:24 +03:00
Mikhail Zarechenskiy e49cdf0ca2 Prohibit using suspend functions as SAM in fun interfaces
#KT-40978 Fixed
2020-08-10 22:04:16 +03:00
Jinseong Jeon 0e54f98b79 FIR: support adapted callable reference with vararg 2020-08-03 16:37:36 +03:00
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
Jinseong Jeon 5a3367e09c FIR: initial support of suspend conversion for function reference 2020-07-28 13:37:05 +03:00
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