aleksey.tomin
06/15/2020, 12:45 PM@SharedImmutable
var APPENDER: Appender = ConsoleOutputAppender
And I have error
kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
...
at 6 app.kexe 0x00000001022aae84 kfun:mu.<get-APPENDER>()Appender + 100 (File.kt:10:1)
on read this variable.
But why? @SharedImmutable
was added.Elena Lepilkina
06/15/2020, 12:52 PMSharedImmutable
is applicable only to val
, please, change var
to val
. Such code in 1.4
will produce error during compilation.aleksey.tomin
06/15/2020, 4:29 PMBig Chungus
06/15/2020, 7:11 PMBig Chungus
06/15/2020, 7:12 PMBig Chungus
06/15/2020, 7:12 PMBig Chungus
06/15/2020, 7:13 PMBig Chungus
06/15/2020, 7:16 PMaleksey.tomin
06/15/2020, 7:18 PMAtomicReference
🙂kpgalligan
06/15/2020, 7:20 PMBig Chungus
06/15/2020, 7:21 PMBig Chungus
06/15/2020, 7:29 PMBig Chungus
06/15/2020, 7:31 PMkpgalligan
06/15/2020, 7:36 PMkpgalligan
06/15/2020, 7:38 PMkpgalligan
06/15/2020, 7:39 PMkpgalligan
06/15/2020, 7:40 PMkpgalligan
06/15/2020, 7:40 PMBig Chungus
06/15/2020, 7:45 PMBig Chungus
06/15/2020, 7:45 PMkpgalligan
06/15/2020, 7:47 PMBig Chungus
06/15/2020, 8:03 PMBig Chungus
06/15/2020, 8:03 PMkpgalligan
06/15/2020, 8:09 PMBig Chungus
06/15/2020, 8:12 PM