when are generics going to be fixed?
# announcements
r
when are generics going to be fixed?
z
In what particular ways do you consider them broken?
r
Copy code
val col = co.preshow.db.PreshowVideoWatchLogs.watchTimeInMilliseconds.max()
    val videoToWatchTime = user?.let {
        co.preshow.db.PreshowVideoWatchLogs.slice(col, co.preshow.db.PreshowVideoWatchLogs.video)
                .select { co.preshow.db.PreshowVideoWatchLogs.user.eq(user.id).and(co.preshow.db.PreshowVideoWatchLogs.video.inList(videos.map { it.video.id })) }
                .groupBy(co.preshow.db.PreshowVideoWatchLogs.video)
                .map {
                    it[co.preshow.db.PreshowVideoWatchLogs.video].value to it[col]
                }.toMap()
    } ?: kotlin.collections.emptyMap()
i have to pull out PreshowVideoWatchLogs.watchTimeInMilliseconds.max()
into its own variable to reference it
Screen Shot 2020-06-15 at 8.39.01 AM.png,Screen Shot 2020-06-15 at 8.38.44 AM.png,Screen Shot 2020-06-15 at 8.40.58 AM.png
j
What about return type
Single<out User>
r
breaks stuff further down the line
j
And what if you add null safety?
does it behave differently then?
hmm.... sounds a bit stupid when I type it out 🙂
r
I think the compiler is getting too quirky
much like how every variable is public unless noted, same should be for generics.
no restrictions
j
perhaps with the new type inference of Kotlin 1.4 it will be better
r
perhaps
k
the ide should be using new inference already
Have you tested if it compiles? Might be a new bug? And what is
Single<T>
?
z
You can opt-in to the new inference even if you're not on 1.4, I'd be curious if that changes anything
k
the ide should be using new inference already
r
Single is from rx, T is just a generic.