james
01/23/2017, 11:03 PMmg6maciej
01/25/2017, 11:19 AMalexp11223
01/25/2017, 8:15 PMfun f(f1: () -> Unit = ::emptyOp, f2: () -> Unit = ::emptyOp)
and I call it via f { }
does it set the first or the last parameter?
I thought the first, but looks like it's the opposite?rocketraman
01/25/2017, 8:18 PMshiraji
01/26/2017, 8:09 AMobject
? The following code compile.
interface I {
fun foo()
}
object O : I {
override fun foo() {
println("Foo!!!")
}
}
class C : I by O
fun main(args: Array<String>) {
C().foo() // Foo!!!
}
mikehearn
01/26/2017, 11:05 AMdh44t
01/26/2017, 11:29 AMmk
01/26/2017, 11:39 AMdh44t
01/26/2017, 11:51 AMokkero
01/26/2017, 2:53 PMokkero
01/26/2017, 5:24 PMmbstavola
01/27/2017, 2:24 AMjava.lang.NoSuchMethodError: kotlin.jvm.internal.FunctionReference.<init>(ILjava/lang/Object;)V
Out of nowhere my code stopped working, invalidate + restart and a clean build didn't fix it, nor did bumping the compiler + std number (was on 1.1 M4, now on 1.1 beta-17).miha-x64
01/27/2017, 4:41 PM{@link }
tag in javadocedalorzo
01/30/2017, 10:28 PMinternal fun hello(name: String): String {
return "Hello " + name
}
compiled it with kotlinc (1.0.6-release-127) and then disassembled it
public final class DemoKt {
public static final java.lang.String hello(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/String;
Code:
0: aload_0
1: ldc #9 // String name
3: invokestatic #15 // Method kotlin/jvm/internal/Intrinsics.checkParameterIsNotNull:(Ljava/lang/Object;Ljava/lang/String;)V
6: new #17 // class java/lang/StringBuilder
9: dup
10: invokespecial #21 // Method java/lang/StringBuilder."<init>":()V
13: ldc #23 // String Hello
15: invokevirtual #27 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
18: aload_0
19: invokevirtual #27 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
22: invokevirtual #31 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
25: areturn
}
And it looks like it produced just a regular public function.dirk.dittert
01/31/2017, 6:46 AMelect
01/31/2017, 11:03 AMimport kotlin.experimental.*
?bamdmux
02/02/2017, 10:26 AMhackerham
02/02/2017, 11:26 AMsreich
02/02/2017, 8:51 PMnkiesel
02/03/2017, 2:07 AMtry (Connection c = getConnection(); ResultSet rs = getRS(c, query) { while (rs.next()) { ... } }
elect
02/03/2017, 9:38 AMbombe
02/04/2017, 4:45 PMInjector.() -> Page
, how do I specify a literal for that?groostav
02/05/2017, 9:30 PMPaul Woitaschek
02/06/2017, 8:24 AMxap4o
02/06/2017, 9:52 AMmikehearn
02/07/2017, 11:54 AMorangy
02/08/2017, 10:25 AMlistOf(1, “2”, 3).filterIsInstance<String>().first()
which gives you String
valuevach
02/08/2017, 10:34 AMfun enter(key: String) {
if (disabled) {
return
}
// lots of code
}
when i decompile kotlin bytecode to see what is the underlying java code i see this
public final void enter(@NotNull String key) {
Intrinsics.checkParameterIsNotNull(key, "key");
if(!disabled) {
// lots of code moved inside inverted if
}
}
not a big deal just curious why inverting the if statement? i cant think of some low level performance trick that may be the reason for thiscaelum19
02/08/2017, 11:18 PMcaelum19
02/08/2017, 11:18 PMbashor
02/20/2017, 12:56 PMcaelum19
02/20/2017, 5:13 PMbashor
03/06/2017, 6:38 PMcaelum19
03/12/2017, 4:59 PMbashor
03/13/2017, 6:29 PMAh, I guess that would mean compiling the JS compiler with itself and modifying it not to use non-kotlin libs?Yes, it’s final solution that we want to have. But for the near future, we can try to convert JVM BC to JS