Skip to content

Commit 90f4c5e

Browse files
mark generic of NonEmptyCollection with out to align it with Collection
1 parent eade3af commit 90f4c5e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package 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()

0 commit comments

Comments
 (0)