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 11package com.quickbirdstudios.nonEmptyCollection
22
3- interface NonEmptyCollection <T > : Collection <T > {
3+ interface NonEmptyCollection <out T > : Collection <T > {
44
55 @Deprecated(
66 level = DeprecationLevel .ERROR ,
77 message = " Is never null!" ,
88 replaceWith = ReplaceWith (" first()" )
99 )
1010 fun firstOrNull (): T = first()
11-
12- @Deprecated(
13- level = DeprecationLevel .ERROR ,
14- message = " Alternative is never used!" ,
15- replaceWith = ReplaceWith (" first()" )
16- )
17- fun firstOr (alternative : () -> T ): T = first()
1811}
12+
13+ @Deprecated(
14+ level = DeprecationLevel .ERROR ,
15+ message = " Alternative is never used!" ,
16+ replaceWith = ReplaceWith (" first()" )
17+ )
18+ fun <T > NonEmptyCollection<T>.firstOr (alternative : () -> T ): T = first()
You can’t perform that action at this time.
0 commit comments