david.bilik
11/28/2017, 8:27 AMDate
in my code, it adds this import import java.util.*
instead of just import java.util.Date
like in Java files. Is there any purpose?jchannon
11/28/2017, 9:26 AMalexcouch
11/28/2017, 9:38 AMjchannon
11/28/2017, 10:25 AMfun <T:Any> get(c: KClass<T>) : T{
return c.createInstance()
}
Czar
11/28/2017, 10:52 AMfun AbstractPartial.isBeforeOrEqual(other: ReadablePartial): Boolean = !isAfter(other)
fun AbstractPartial.isAfterOrEqual(other: ReadablePartial): Boolean = !isBefore(other)
The problem with directly using something like !isAfter(other)
is the exclamation mark, arguably it is harder to spot and read than readable name like isBeforeOrEqual(other)
.louiscad
11/28/2017, 2:57 PMmarstran
11/28/2017, 2:59 PMPaul Woitaschek
11/28/2017, 3:20 PMPaul Woitaschek
11/28/2017, 3:30 PMdierre
11/28/2017, 3:42 PMc1.flatMap(x => c2.flatMap(y => c3.map(z => {...})))
which in scala would be for(x <- c1; y <- c2; z <- c3) yield {...}
adam-mcneilly
11/28/2017, 3:52 PMyole
11/28/2017, 4:03 PMtschuchort
11/28/2017, 4:08 PMjchannon
11/28/2017, 4:08 PMegorand
11/28/2017, 4:36 PM*arrayOf()
which is kinda verbose. Is there a better way?ehubbard
11/28/2017, 4:48 PMjlleitschuh
11/28/2017, 4:49 PM1.2.0
needs to be updated.
http://kotlinlang.org/docs/reference/compatibility.htmlJorge Castillo
11/28/2017, 4:54 PMexpected
on a common module and actual
in a platform one?jlleitschuh
11/28/2017, 5:24 PMclass NamedDomainObjectContainerScope<T : Any>(
private val container: NamedDomainObjectContainer<T>) : NamedDomainObjectContainer<T> by container {
operator fun String.invoke(configuration: T.() -> Unit): T =
this().apply(configuration)
/**
* @see [NamedDomainObjectContainer.maybeCreate]
*/
inline
operator fun <reified U : T> String.invoke(configuration: U.() -> Unit): U =
this(U::class).apply(configuration)
}
Use case:
I want to be able to do this:
container { // `this` is type `NamedDomainObjectContainerScope<Task>`
"allice" { /* Type Task in this scope*/ }
"bob"<ExtendedTaskType> { /* Type ExtendedTaskType in this scope*/ }
}
My more general problem is that I'm trying to add reified
overloads for all of these methods in the Gradle Kotlin DSL:
https://github.com/gradle/kotlin-dsl/blob/6a3c51a65e8423aa33432b816996360cd32e7906/provider/src/main/kotlin/org/gradle/kotlin/dsl/NamedDomainObjectContainerExtensions.ktfjanicki
11/28/2017, 5:27 PMtapchicoma
11/28/2017, 7:41 PMReplaceWith
in @Depreacted
annotation for properties? I want to update from:
val someField = someValue
to
val someFields = arrayOf(someValue)
Using ReplaceWith("val someFields = arrayOf(x)")
produces val someFields = arrayOf(x)
on IDEA action 😞jchannon
11/28/2017, 8:18 PMg4sarma
11/28/2017, 9:25 PMcedric
11/28/2017, 9:43 PMchansek
11/29/2017, 3:22 AMchansek
11/29/2017, 3:22 AMdave
11/29/2017, 9:42 AMsourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
in my gradle file, and the project SDK is set correctly to 1.8. Is there another flag I'm missing for targetPlatform
?michaelzinn
11/29/2017, 10:19 AMedwardwongtl
11/29/2017, 10:46 AMPaul Woitaschek
11/29/2017, 12:30 PMPaul Woitaschek
11/29/2017, 12:30 PMorangy
11/29/2017, 12:32 PMPaul Woitaschek
11/29/2017, 12:32 PMorangy
11/29/2017, 12:33 PMPaul Woitaschek
11/29/2017, 12:35 PMthis
orangy
11/29/2017, 12:36 PMPaul Woitaschek
11/29/2017, 12:42 PM