Nathan Bedell
10/15/2021, 2:04 PM.first()
that should have been a .firstOrNull()
that snuck past code review leads to an application crash. Since .first()
is annotated @Throws
I'd at least like to be warned of the possibility of an unhandled exception there that can either be handled, or explicitly suppressed if I can reason to myself it can never happen (Of course, then I'd ideally want to use a NonEmptyList
🙂 -- but the desire to have a plugin like this still stands).Nathan Bedell
10/15/2021, 2:07 PMEither
is the more functional way of doing this, but here I'm thinking of something in the stdlib or a third-party library.
My current approach is to define a detekt rule that warns against problematic unsafe functions -- but I feel like it would be better if there were a more comprehensive solution.raulraja
10/15/2021, 2:27 PMraulraja
10/15/2021, 2:28 PMraulraja
10/15/2021, 2:29 PMraulraja
10/15/2021, 2:30 PMraulraja
10/15/2021, 2:32 PMpdvrieze
10/18/2021, 10:31 AMResult
is now allowed to be used outside of coroutines, so is a stdlib compatible alternative to Either
(in some cases)Nathan Bedell
11/13/2021, 1:31 AMraulraja
11/13/2021, 10:36 AMNathan Bedell
11/13/2021, 2:48 PMraulraja
11/13/2021, 3:09 PMraulraja
11/13/2021, 3:10 PMNathan Bedell
11/13/2021, 3:19 PMraulraja
11/13/2021, 6:04 PM