Narayan Iyer
11/03/2018, 2:39 PMCoursera
. I tried it on the Kotlin REPL
. Any ideas why it is giving that error? Thanks!
BTW, I get the same error for: displayError()
!!!Luke
11/04/2018, 8:32 PMant -f update_dependencies.xml
. I get an error saying:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Buildfile: update_dependencies.xml does not exist!
Build failed
Any tips?febs
11/05/2018, 9:39 AMjacob
11/05/2018, 10:51 AMkarelpeeters
11/05/2018, 11:30 AMAPXEOLOG
11/05/2018, 1:22 PMT
from the klass
?
fun <T> getProperty(klass: KClass<*>): T? {
return properties.find { it::class == klass } as T?
}
Right now it's working as entity.getProperty<String>(String::class)
and i want entity.getProperty(String::class)
kartikpatodi
11/05/2018, 7:12 PMclass A1(private val x: Int) {
private val y: Int = 0
}
generates this code in Java
public final class A1 {
private final int y;
private final int x;
public A1(int x) {
this.x = x;
}
}
while
class A2(private val x: Int) {
private val y: Int
init {
y = 0
}
}
generates
public final class A2 {
private final int y;
private final int x;
public A2(int x) {
this.x = x;
this.y = 0;
}
}
Why if init block y=0
is in constructor of A2
and not otherwise in case of A1
?yen
11/06/2018, 9:39 AMNikky
11/06/2018, 8:13 PM)
?karelpeeters
11/06/2018, 8:14 PMNikky
11/06/2018, 8:16 PMa ?: let {} ?: return b
seems okay
a is final and always initialized to null so the let block is dead codeAlpesh Vas
11/06/2018, 8:33 PMNikky
11/06/2018, 8:38 PMc
Kevin Huang
11/07/2018, 10:35 AMKevin Huang
11/07/2018, 10:44 AMrnpy
11/08/2018, 9:59 AMfunctionThatTakesAVarargAsParameter(*fictionData )
?APXEOLOG
11/08/2018, 11:56 AMarrayOf
exactly what i need, thanksCamilleBC
11/08/2018, 12:18 PMfun List<E>.getDifference(other: List<E>) = this.union(other) - this.intersect(other)
nestserau
11/08/2018, 4:47 PMif (f.value in from..to && !c.isEmpty)
, then it doesn’t compile saying Type interference failed
. Any other options?
fun notEmptyFieldInRange(from: UByte, to: UByte): Boolean {
for ((f, c) in fields)
if (f.value >= from && f.value <= to && !c.isEmpty)
return true
return false
}
Serge
11/08/2018, 9:51 PMval o = object{}
val mm = o.javaClass.declaredMethods
but it doesn't return anything. is it possible at all? if so, would the function modifier affect this search (private, public, etc)?ClaudiuB
11/09/2018, 5:58 AMStateful by state()
part of this should be interpreted? class MySuperCoolActivity : Activity(), Stateful by state()
and state()
is a global functionkartikpatodi
11/09/2018, 7:01 AMSaiedmomen
11/09/2018, 2:29 PMhimrin
11/09/2018, 2:55 PMlegzo
11/09/2018, 4:01 PMinternal
would do the trick but the internal function is visible from java, as : myInternalFunc$my_module_name.
What am I missing ? 🤔
Mmmm read the doc a bit more and saw that internal is mapped to public in java with some name mangling.
Do you know another way to do what I want to do ?febs
11/09/2018, 11:12 PMStuart Rivero
11/10/2018, 6:54 PMbodiam
11/11/2018, 10:19 AMMrNiamh
11/11/2018, 7:33 PMChris Cunningham
11/11/2018, 10:07 PMChris Cunningham
11/11/2018, 10:07 PMMike
11/12/2018, 2:06 AM