File tree Expand file tree Collapse file tree
src/commonMain/kotlin/com/quickbirdstudios/nonEmptyCollection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,19 +7,12 @@ interface NonEmptyCollection<T> : Collection<T> {
77 message = " Is never null!" ,
88 replaceWith = ReplaceWith (" first()" )
99 )
10- fun firstOrNull (): T ? = throw NotImplementedError ()
10+ fun firstOrNull (): T = first ()
1111
1212 @Deprecated(
1313 level = DeprecationLevel .ERROR ,
1414 message = " Alternative is never used!" ,
1515 replaceWith = ReplaceWith (" first()" )
1616 )
17- fun firstOr (alternative : () -> T ): T = throw NotImplementedError ()
18-
19- @Deprecated(
20- level = DeprecationLevel .ERROR ,
21- message = " Alternative is never used!" ,
22- replaceWith = ReplaceWith (" " )
23- )
24- fun <R > ifEmpty (defaultValue : () -> R ): R = throw NotImplementedError ()
17+ fun firstOr (alternative : () -> T ): T = first()
2518}
You can’t perform that action at this time.
0 commit comments