[NI] Prefer between two complex variables one with proper lower bounds
This reverts commit d4d35bb766.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// FIR_IDENTICAL
|
||||
// FULL_JDK
|
||||
|
||||
import java.time.LocalDate
|
||||
|
||||
data class DailyTime(val date: LocalDate)
|
||||
|
||||
fun <T : Comparable<T>> Sequence<T>.range(): ClosedRange<T>? {
|
||||
val iter = iterator()
|
||||
return when {
|
||||
iter.hasNext() -> iter.next().let { it..it }
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
fun test(dailyTimes: List<DailyTime>): List<DailyTime> {
|
||||
val dateRange = dailyTimes.asSequence().map { it.date }.range() ?: return emptyList()
|
||||
println(dateRange.start)
|
||||
return dailyTimes
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ dailyTimes: kotlin.collections.List<DailyTime>): kotlin.collections.List<DailyTime>
|
||||
public fun </*0*/ T : kotlin.Comparable<T>> kotlin.sequences.Sequence<T>.range(): kotlin.ranges.ClosedRange<T>?
|
||||
|
||||
public final data class DailyTime {
|
||||
public constructor DailyTime(/*0*/ date: java.time.LocalDate)
|
||||
public final val date: java.time.LocalDate
|
||||
public final operator /*synthesized*/ fun component1(): java.time.LocalDate
|
||||
public final /*synthesized*/ fun copy(/*0*/ date: java.time.LocalDate = ...): DailyTime
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user