skennedy
08/04/2017, 9:21 PM<T extends View> T findViewById(int id)
, why do i need to specify <View>
? Shouldn’t the compiler default the type to View
if I don’t specify something more concrete?trevjones
08/04/2017, 9:32 PMtrevjones
08/04/2017, 9:33 PMjw
08/04/2017, 9:34 PMjw
08/04/2017, 9:35 PMjlleitschuh
08/04/2017, 11:44 PMgildor
08/05/2017, 3:49 AMjw
08/05/2017, 10:08 PM@Deprecated(level = ERROR)
functions without the overhead of an entire project?jw
08/05/2017, 10:08 PMjw
08/05/2017, 10:09 PMfun Base.whatever()
@Deprecated(level = ERROR) fun Impl.whatever()
jw
08/05/2017, 10:10 PMBase.whatever()
whenever Base
is actually an Impl
, but I'd like to test that when you have an Impl
and you call whatever()
you receive an error.jw
08/05/2017, 10:14 PMorangy
jw
08/05/2017, 10:36 PMredrield
08/06/2017, 1:59 PMget()
on a property from my primary constructor in a data class?damien5314
08/06/2017, 3:49 PMdumptruckman
08/06/2017, 5:01 PMdumptruckman
08/06/2017, 5:10 PMkarelpeeters
08/06/2017, 5:13 PMdumptruckman
08/06/2017, 5:14 PMdumptruckman
08/06/2017, 5:20 PMkarelpeeters
08/06/2017, 5:30 PMkarelpeeters
08/06/2017, 5:39 PMgetValue
twice.jw
08/06/2017, 6:10 PMfun <I, O> Collection<I>.flatMap(func: (I) -> List<O>): List<O> = TODO()
fun <I, O> Collection<I>.flatMap(func: (I) -> Collection<O>): Collection<O> = TODO()
fun <I, O> List<I>.flatMap(func: (I) -> Collection<O>): Collection<O> = TODO()
fun main(vararg args: String) {
val collection: Collection<Int> = listOf(1)
listOf(1).flatMap { collection }
}
This currently fails with:
Error:(7, 12) Cannot choose among the following candidates without completing type inference:
public fun <I, O> Collection<Int>.flatMap(func: (Int) -> Collection<???>): Collection<???> defined in root package
public fun <I, O> Collection<Int>.flatMap(func: (Int) -> List<???>): List<???> defined in root package
public fun <I, O> List<Int>.flatMap(func: (Int) -> Collection<???>): Collection<???> defined in root package
If I specify flatMap<Int, Int>
explicitly, I then get:
Error:(7, 12) Overload resolution ambiguity:
public fun <I, O> Collection<Int>.flatMap(func: (Int) -> Collection<Int>): Collection<Int> defined in root package
public fun <I, O> Collection<Int>.flatMap(func: (Int) -> List<Int>): List<Int> defined in root package
public fun <I, O> List<Int>.flatMap(func: (Int) -> Collection<Int>): Collection<Int> defined in root package
Is this expected? I would think that given the type information, the third function would match. But even without explicit type information, I would expect it to match. The receiver type is the most specific and then function signature matches perfectly.jenji
08/06/2017, 7:57 PMkotlin
and kotlin2js
plugins? When I try, I get an error that says Cannot add extension with name 'kotlin', as there is an extension already registered with that name
. I initially tried with the kotlin gradle dsl, but it doesn't work with the groovy dsl either.
My only thought is that I might be able to do it with a multi module project, and separate the js and jvm code bases.jw
08/06/2017, 8:00 PMblakelee
08/06/2017, 8:05 PMval test: String get() = "test"
outside of a function or inside of a class, but not
fun main(args: Array<String>) {
val test: String get() = "test"
}
jw
08/07/2017, 4:01 AMmyanmarking
08/07/2017, 9:32 AMmyanmarking
08/07/2017, 9:32 AM