cedric
05/05/2017, 9:57 PMpoohbar
05/06/2017, 12:58 AMthis
into one of the properties I have in my class.. is there anything better or more idiomatic I could do than:
class Main {
lateinit var manager: Manager
init {
manager = Manager(this)
}
}
poohbar
05/06/2017, 4:07 PMpartition()
is just another useless groupBy()
poohbar
05/07/2017, 12:40 PMfun <T> T.debug(): T {
println(this)
return this
}
evkaky
05/10/2017, 3:57 PMclass MyClass {
companion object {
fun myCoolStaticMethod() {
}
}
}
Java library (junit 5), which expects existing of static method myCoolStaticMethod tell me, that there is no such method in MyClass
What I’am doing wrong?poohbar
05/10/2017, 7:37 PMstoyicker
05/12/2017, 12:36 PMdeinspanjer
05/12/2017, 3:30 PMpoohbar
05/12/2017, 4:43 PMval t: Target = Target(...)
before I have defined the class Target
it assumes it is the annotation instead of sayin it is unresolved.deinspanjer
05/12/2017, 5:45 PMpoohbar
05/12/2017, 8:38 PM{ x: Int, y: Int -> x + y }
we can explicitly specify the type of parameters. Can we also specify the return type?moltendorf
05/15/2017, 5:31 AMval squares = squares.dropWhile { it.area < id - it.area }.take(2)
val previous = squares.first()
val current = squares.last()
cedric
05/15/2017, 2:45 PMnoctarius
05/18/2017, 4:49 AMroee
05/18/2017, 7:27 AMmrtreinis
05/18/2017, 1:14 PMmaciekjanusz
05/18/2017, 1:31 PMInt
and Int?
compile to one or different class filesorangy
05/18/2017, 1:33 PMInt?
is always Integer
, but non-null Int
can be either Integer
or int
maciekjanusz
05/18/2017, 1:38 PM@Nullable
/ @Nonnull
are those? usually these don't have runtime retention, so I guess it's still not possible to infer nullability using reflection, no?diesieben07
05/18/2017, 2:42 PMantonioleiva
05/18/2017, 4:00 PMmoltendorf
05/18/2017, 8:55 PMrahulsom
05/19/2017, 2:24 AMpublic interface AggregateType<AggregateIdT> {
AggregateIdT getId();
}
I wrote this in my kotlin class
data class Patient(val id: String, val identifier: String): AggregateType<String>
I'm assuming that kotlin would provide me a getId()
method. However, I get this error:
Class 'Patient' must be declared abstract or implement abstract member public abstract fun getId(): String!
When I do try to implement it like this:
data class Patient(val id: String, val identifier: String): AggregateType<String> {
override fun getId() = id
}
I get a Platform Declaration clash.rahulsom
05/19/2017, 2:24 AMconner
05/19/2017, 4:44 AMdependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8"
}
conner
05/19/2017, 4:58 AMleodeleon
05/19/2017, 6:09 AMapply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
...
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.google.dagger:dagger:2.10'
kapt 'com.google.dagger:dagger-compiler:2.10'
pkworlz
05/19/2017, 7:34 AMcodebeast
05/19/2017, 8:01 AMclass Person(val name: String) {
constructor(name: String, parent: Person) : this(name) {
parent.children.add(this)
}
}
and here:
class MyView : View {
constructor(ctx: Context) : super(ctx)
constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs)
}
Wondering if I could get a clearer description of what happens. Thankscodeinbit
05/19/2017, 8:52 AMcodeinbit
05/19/2017, 8:52 AMvincentloi
05/19/2017, 8:53 AMcodeinbit
05/19/2017, 8:55 AM