pugnator
01/26/2019, 8:00 AMAndrew Gazelka
01/26/2019, 4:18 PMhyukchan
01/26/2019, 8:35 PMhyukchan
01/26/2019, 8:41 PMDico
01/26/2019, 9:39 PM*
import.
The reality is that the first rule seems to take priority over the second.
I think it should be the other way around.
What do you think?Andrew Gazelka
01/27/2019, 3:02 AMoverride fun <SubsystemStateCondition>getConditionValue(): SubsystemStateCondition {
return state
}
interface Condition {
fun <T> getConditionValue(): T
}
pajatopmr
01/27/2019, 8:19 AMval someClass: KClass<out Foo>
is it possible for someClass.objectInstance
to be null? I think the answer is yes but I am struggling to come up with a way to make a test for such a thing. The documentation for objectInstance says, ” …if this class is not an object declaration” so my question really boils down to: how do I define a class that is not an object declaration? And the corollary, can I define a member of a sealed class that is not an object declaration. If you’re inclined to reply, please do so in a thread. Thanks. fwiw, my brain hurts just trying to grok this.Dalinar
01/27/2019, 12:02 PMhyukchan
01/27/2019, 1:14 PMhyukchan
01/27/2019, 1:33 PMDavide Giuseppe Farella
01/27/2019, 2:00 PMprivate
modifier, ok with nothing( public
), internal
or even protected
Tasos Stamadianos
01/27/2019, 6:53 PM17:10:33.977 [main] ERROR bees.stream.MessageStream - [MessageStream.kt:42] || - Message deserialization failed.
kotlin.reflect.full.IllegalCallableAccessException: java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$Constructor cannot access a member of class bees.stream.MessageStream$SystemMessage with modifiers "public"
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:224)
at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflect_api(KCallableImpl.kt:152)
at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:110)
at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:104)
at com.squareup.moshi.JsonAdapter$2.fromJson(JsonAdapter.java:137)
at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:41)
at bees.stream.MessageStream.onMessages(MessageStream.kt:39)
at bees.stream.kafka.KafkaConsumerProducerStream.start(KafkaProducerConsumerStream.kt:64)
at bees.BeesKt.main(bees.kt:65)
Caused by: java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$Constructor cannot access a member of class bees.stream.MessageStream$SystemMessage with modifiers "public"
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at kotlin.reflect.jvm.internal.calls.CallerImpl$Constructor.call(CallerImpl.kt:41)
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:106)
... 8 common frames omitted
17:10:33.989 [main] DEBUG bees.stream.MessageStream - [MessageStream.kt:83] || - Completed message processing. Returning 0 responses.
I have a Moshi instance whose job it is to do this deserialization. The class it wants to create is:
private data class SystemMessage(val command: String, val sessionId: UUID, val commandId: UUID, val data: Any)
. This is private to the class within the module.
This only happens when the app is running for longer periods, if I restart and try again it works fine. When I search "java cannot access a member of a class with modifiers public", I get results which indicate that the class cannot be instantiated since it's private to its enclosing class. However, this doesn't explain why it works for some time if I restart the app. I've tried with JVM 8 and JVM 11, same error on both. This was built with Kotlin 1.3.10, but I'm going to try 1.3.20 now.
Any help would be greatly appreciated 🙂Marc Knaup
01/27/2019, 7:45 PMjava.lang.IncompatibleClassChangeError: com.github.fluidsonic.fluid.json.ListJSONDecoderCodec and com.github.fluidsonic.fluid.json.ListJSONDecoderCodec$$special$$inlined$create$1 disagree on InnerClasses attribute
Andrew Gazelka
01/27/2019, 8:37 PMI
?Nikky
01/27/2019, 9:03 PMorg.jetbrains.kotlinx:kotlinx-html-jvm:0.6.10
get removed from the kotlinx repo ?Paul N
01/28/2019, 9:21 AMAnton
01/28/2019, 1:37 PMaerialist
01/28/2019, 3:10 PMrun
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/run.html) which returns nothing (Unit
) (see code block).
towards
function purpose: run block()
in scope of T
. And if block()
returns some result - it must be ignored.
Kotlin-Dev Team, could you please recommend better name? And do you have plans to add same extension to language?
Thank you in advance.Marcin Wisniowski
01/28/2019, 6:37 PMxenoterracide
01/28/2019, 7:19 PMjlleitschuh
01/28/2019, 7:26 PM1.3.20
and now I'm getting java.lang.OutOfMemoryError: Metaspace
exceptions from the Koltin compiler. I'm also using the kotlin.parallel.tasks.in.project=true
flag.
Is this a known issue & is there a workaround?Robert
01/28/2019, 7:38 PMif (myByte.compareTo(myInt) == 0)
? if (myByte.toInt() == myInt)
? if (myByte == myInt.toByte())
? Something else? Or can I force implicit conversion somehow, as I have a lot of these comparisons?Dominaezzz
01/28/2019, 8:17 PMsnowe
01/28/2019, 11:14 PMCaused by: java.lang.IllegalStateException: Resource not found in classpath: kotlin/coroutines/coroutines.kotlin_builtins
I believe it may have something to do with the fact that we have a gradle build with a maven parent pom using gradle’s implementation(platform())
ability.Andrew Gazelka
01/29/2019, 12:04 AMsnowe
01/29/2019, 6:52 AMfun Suite.mapsTo(expected: String) {
val testObject by memoized<Any>()
it("test value") {
pp(testObject)
outContent shouldRenderLike expected
}
}
fun testObject(obj: Any?) {
val testObject by memoized { obj }
}
describe("tiny object should") {
context("render a single field") {
testObject(TinyObject(1))
mapsTo(
"""
TinyObject(
int = 1
)
"""
)
}
}
but I find it very messy, and I can't use an infix....thana
01/29/2019, 7:17 AMjdemeulenaere
01/29/2019, 1:43 PMDalinar
01/29/2019, 2:12 PMDalinar
01/29/2019, 2:12 PMDalinar
01/29/2019, 2:12 PMrobin
01/29/2019, 2:38 PMdata class Person(val string: String, val int: Int, val any: Any)
has a generated hashcode function that boils down to something like this this:
override fun hashCode(): Int {
return ((string?.hashCode() ?: 0) * 31 + int * 31) + (any?.hashCode() ?: 0)
}