RxKotlin icon indicating copy to clipboard operation
RxKotlin copied to clipboard

SAM Issue Resolved with Upcoming Type Inference Overhaul

Open thomasnield opened this issue 7 years ago • 7 comments

At KotlinConf 2018, a new type inference system was announced and it will fix the SAM issue. I believe this is going to be in experimental stages for some time and is slated for Kotlin 1.4.

I am documenting this right now so we'll remember to deprecate the SAM helper functions upon the release of this much-needed feature.

thomasnield avatar Oct 06 '18 10:10 thomasnield

Guys from Kotlin announced Experimental mechanism for libraries same as for compiler experimental features. Probably we could use it to support new type inference.

stepango avatar Oct 07 '18 12:10 stepango

I kept looking for a timeline for this, did they announce any?

thomasnield avatar Oct 08 '18 12:10 thomasnield

It looks like this is available as an experimental feature in Kotlin 1.3. Here is how to activate it: https://discuss.kotlinlang.org/t/new-type-inference-in-kotlin-1-3-0-rc-190/9914/2

thomasnield avatar Nov 06 '18 13:11 thomasnield

This produces warnings now when building with Kotlin 1.4.0 and RxKotlin 3.0.0, due to several candidates being available:

Candidate resolution will be changed soon, please use fully qualified name to invoke the following closer candidate explicitly

Edit: The case I encountered was readily fixed by removing the extension function import. My bad.

bubenheimer avatar Aug 20 '20 16:08 bubenheimer

@bubenheimer this has been handled on the 3.x-new-type-inference branch, will merge to main branch soon.

vpriscan avatar Aug 20 '20 16:08 vpriscan

#238 deprecates SAM helper functions

vpriscan avatar Aug 26 '20 21:08 vpriscan

How u can unsubscribe from this list!? I’ve tried so many ways:(

On Wed, 26 Aug 2020 at 17:13 Vedran Prišćan [email protected] wrote:

#238 https://github.com/ReactiveX/RxKotlin/pull/238 deprecates SAM helper functions

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ReactiveX/RxKotlin/issues/197#issuecomment-681127148, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL45BY6V73LIQ7BZDQ2J2XLSCV3JLANCNFSM4FZNEGXA .

victorMontero avatar Aug 26 '20 21:08 victorMontero