udalov
viorgu
01/20/2017, 11:45 AMmkobit
01/20/2017, 1:30 PMsourceCompatibility = JavaVersion.VERSION_1_8
orangy
jakiej
01/20/2017, 6:43 PMval timedOut = arrayOf(false)
thread {
timeOut[0] = true
}
Thread.sleep(100)
println(if (timedOut[0] ) "cool" else "ouch!")
elizarov
01/20/2017, 6:55 PMmarcin.kozinski
01/20/2017, 8:37 PMjakiej
01/20/2017, 9:27 PMboolean b = false;
new Thread(() -> b = true).start();
Idea would suggest changeing b
to a final boolean array:
final boolean[] b = {false};
new Thread(() -> b[0] = true).start();
so this is not guaranteed to work either?miha-x64
01/20/2017, 9:31 PMThread::run
does not start a thread, it runs its code in place.miha-x64
01/20/2017, 9:32 PMmiha-x64
01/20/2017, 9:38 PMjakiej
01/20/2017, 10:00 PMstart
yoavst
01/22/2017, 2:36 PMval array = arrayOf(arrayOf(1,2,3), arrayOf(2,3), arrayOf(3))
val max = array.map(Array<*>::size).max()!!
println(max)
crash on 1.1 Exception in thread "main" java.lang.NoSuchMethodError: [Ljava.lang.Object;.getSize()I
yoavst
01/22/2017, 5:16 PMIan
01/22/2017, 5:49 PMposition != null
is always true, when position clearly can be null? https://www.evernote.com/l/AAQm2wQQm3BHipPFr3axTz_86Fpw2Tt2t2ckirillrakhman
01/22/2017, 5:54 PMIan
01/22/2017, 5:58 PMIan
01/22/2017, 5:58 PMsdeleuze
01/23/2017, 5:43 PMsdeleuze
01/23/2017, 5:44 PMError:Kotlin: [Internal Error] org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'getBean' into
local final fun <anonymous>(it: org.springframework.context.ApplicationContext): org.springframework.context.support.GenericApplicationContextExtensionsTests.BeanB defined in org.springframework.context.support.GenericApplicationContextExtensionsTests.registerBeanWithGradleStyleApi.<anonymous>[AnonymousFunctionDescriptor@4382f79e]
{ BeanB(it.getBean<BeanA>()) }
Cause: Not generated
Cause: Cannot inline bytecode of class org/springframework/beans/factory/BeanFactoryExtensionsKt which has version 52. This compiler can only inline Java 1.6 bytecode (version 50)
File being compiled and position: (65,28) in /Users/seb/Workspace/spring-framework/spring-context/src/test/kotlin/org/springframework/context/support/GenericApplicationContextExtensionsTests.kt
PsiElement: getBean<BeanA>()
The root cause was thrown at: InlineCodegenUtil.java:151
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.throwCompilationException(InlineCodegen.java:203)
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.genCallInner(InlineCodegen.java:189)
at org.jetbrains.kotlin.codegen.CallGenerator.genCall(CallGenerator.kt:104)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2900)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2845)
at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:44)
at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:23)
...
sdeleuze
01/23/2017, 5:44 PMsdeleuze
01/23/2017, 5:45 PMsdeleuze
01/23/2017, 5:45 PMsdeleuze
01/23/2017, 5:46 PMdhkim
01/24/2017, 4:25 AMorangy
dhkim
01/24/2017, 4:51 AMorangy
dhkim
01/24/2017, 4:52 AMorangy