Add cache for direct (which has no closured parameters) KCallable references
Refactor FunctionReferenceLowering
* Rename FunctionReferenceLowering -> CallableReferenceLowering
* Add util method to create value parameters
Supported:
- conversion in resolution parts. Also sam-with-receiver is supported automatically
- separate flag for kotlin function with java SAM as parameters
TODO:
- fix overload conflict error when function type is the same byte origin types is ordered
- consider case when parameter type is T, T <:> Runnable
- support vararg of Runnable
[NI] Turn off synthetic scope with SAM adapter functions if NI enabled
For almost all cases this change do nothing, because if parameter isn't
vararg, then both methods (FlatSignature.argumentValueType &
getExpectedType) return same value. Moreover if it is vararg parameter
and spread operator is not used, then results will be the same.
We can observe difference only when spread operator used
and when we compare two candidates corresponding parameters
for both spread arguments should be vararg parameters.
I.e. old way compares: Int vs String
new way compares: Array<out Int> vs Array<out String>.
Such test has no ense in NI because NI it is LV = 1.4 and we cannot
repeat behaviour in 1.3 anyway, so I propose not even support old cases.
Also priority of LANGUAGE directive should be more then key enabled on
all tests -- also fixed.
Encapsulate daemon run count within DaemonRegistry to simplify reasoning
about the state.
Never count test process Gradle version as active Gradle process.
Fix the bug when daemon version hit max run count threshold
would be restarted every time after that.
Otherwise the test `KotlinAndroid32GradleIT.testIncrementalCompile`
failed with Android resource linking failed error:
"attribute 'package' in <manifest> tag is not a valid Android package name: 'foo'."
Bound references require kotlin-reflect 1.1.x on runtime.
However old Gradle versions (e.g. 3.4) can leak 1.0.x reflect
into Gradle classloader, so getting bound reference fails on runtime
(in this case the plugin couldn't connect to the daemon).
Previous plugin resolution mechanism was only searching
for exact artifact without transitive dependencies.
The configuration allows resolving transitive dependencies,
but it resolves stdlib which fails because the compiler
loads plugins using parent last classloader.
Non-transitivity can be removed after parent last classloader is
removed.