serebit
08/16/2020, 6:15 AMandylamax
08/16/2020, 1:34 PMMalformedClass Name
Why is this?Big Chungus
08/16/2020, 7:53 PMluke
08/16/2020, 9:36 PMnull
Int
as 0
? https://gitpod.io/#snapshot/eee0ffb1-3cd0-428c-b59a-1b314243ecc6ursus
08/17/2020, 3:40 AMLuis Daivid
08/17/2020, 9:43 AMindexOfOrNull
function in Kotlin? According to Roman Elizarov, Null is the cleanest and most obvious way to indicate that there is no value. But There is only indexOf
function that return -1 in kotlin.andylamax
08/17/2020, 10:39 AMno-arg
work with kotlin multiplatform?
I have this gradle
configuration
plugins {
kotlin("multiplatform")
kotlin("plugin.noarg")
}
noArg {
annotations("kotlinx.serialization.Serializable","org.neo4j.ogm.annotation.NodeEntity")
// annotation("org.neo4j.ogm.annotation.NodeEntity")
}
I also have this class
@Serializable
@NodeEntity
open class UserAccount(
@Id
@GeneratedValue
override var id: Long? = null,
override var uid: String = "",
val name: String,
val permits: List<String> = listOf(),
override var deleted: Boolean = false
) : Neo4JEntity
But after compilation, I get this compiled JavaCode
@kotlinx.serialization.Serializable @org.neo4j.ogm.annotation.NodeEntity public open class UserAccount public constructor(id: kotlin.Long? /* = compiled code */, uid: kotlin.String /* = compiled code */, name: kotlin.String, permits: kotlin.collections.List<kotlin.String> /* = compiled code */, deleted: kotlin.Boolean /* = compiled code */) : tz.co.asoft.Neo4JEntity {
public companion object {
}
@kotlin.Deprecated public constructor(seen1: <http://kotlin.Int|kotlin.Int>, id: kotlin.Long?, uid: kotlin.String?, name: kotlin.String?, permits: kotlin.collections.List<kotlin.String>?, deleted: kotlin.Boolean, serializationConstructorMarker: kotlinx.serialization.SerializationConstructorMarker?) { /* compiled code */ }
public open var deleted: kotlin.Boolean /* compiled code */
@field:org.neo4j.ogm.annotation.Id @field:org.neo4j.ogm.annotation.GeneratedValue public open var id: kotlin.Long? /* compiled code */
public final val name: kotlin.String /* compiled code */
public final val permits: kotlin.collections.List<kotlin.String> /* compiled code */
public open var uid: kotlin.String /* compiled code */
public final fun ref(): tz.co.asoft.UserAccountRef { /* compiled code */ }
@kotlin.Deprecated public object `$serializer` : kotlinx.serialization.internal.GeneratedSerializer<tz.co.asoft.UserAccount> {
}
}
As you can see, It surely has no a no argument constructor. How do I achieve this?Bob Glamm
08/17/2020, 1:25 PMpoohbar
08/17/2020, 1:45 PMlaith
08/17/2020, 5:21 PMJoe
08/17/2020, 5:30 PMvar reached = false
With 1.4, line 30 triggers the following warning, but line 48 does not:
DAOTestBaseTest.kt: (30, 23) Variable 'reached' initializer is redundant
I can fix by replacing with var reached: Boolean
, but would like to understand why the 2 instances are being treated differently first.user
08/17/2020, 5:43 PMjeggy
08/17/2020, 6:09 PMinline fun measureTimeMillisWithContract(block: () -> Unit): Long {
contract {
callsInPlace(block, EXACTLY_ONCE)
}
val start = System.currentTimeMillis()
block()
return System.currentTimeMillis() - start
}
but as it requires me to add the @ExperimentalContracts
annotation, I don't really feel good to use contracts.Manuel Pérez Alcolea
08/17/2020, 7:53 PMasSequence()
instead. And something like a direct map
gives you a list. But I would still assume a range object doesn't contain anything, simply because "it makes sense" in my head.
>>> (0..4).asSequence()
res0: kotlin.sequences.Sequence<kotlin.Int> = kotlin.collections.CollectionsKt___CollectionsKt$asSequence$$inlined$Sequence$1@7bafb922
>>> (0..4).map { it * 2 }
res1: kotlin.collections.List<kotlin.Int> = [0, 2, 4, 6, 8]
So what's in an IntRange
before applying anything? (no asSequence()
) for example val myRange = 0..4
Rohen Giralt
08/17/2020, 9:38 PMSrSouza
08/18/2020, 1:54 AMjava.lang.NoSuchMethodError: kotlin.jvm.internal.FunctionReferenceImpl.<init>(ILjava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V
at line 62 ( in 1.3.72 was working )spierce7
08/18/2020, 2:35 AMlaht
08/18/2020, 9:03 AMYuri
08/18/2020, 9:09 AMfun interface Plugin {
suspend fun onFinish()
}
‘suspend’ modifier is not allowed on a single abstract member
Paul Woitaschek
08/18/2020, 10:27 AMx.maxBy { ...}!!
is x.maxByOrNull { ...}!!
and that there is no replacement that throws if the result is null?Alexander Schell
08/18/2020, 11:24 AMCaused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/KTypeBase
Seems to be a problem with spring.Bruno_
08/18/2020, 12:32 PMCannot access 'Foo': it is internal in 'some.package'
gradle builds and runs it just fine thoLuis Daivid
08/18/2020, 2:10 PM./gradlew -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000
But it fails with this error.
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /Users/iLand/.gradle/wrapper/dists/gradle-6.6-bin/dflktxzwamd4bv66q00iv4ga9/gradle-6.6-bin.zip at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
How can I run the test code of the project?Ruckus
08/18/2020, 2:16 PMcompileKotlin
and compileTestKotlin
at the same time? I just ran into an issue where I forgot to turn it on for tests (and it took far longer than it should have to realize my mistake and what the compiler was complaining about).Sam Garfinkel
08/18/2020, 3:26 PMkevin.cianfarini
08/18/2020, 3:44 PMUInt.rotateLeft
and UInt.rotateRight
being normal functions and not infix
?csturtevant
08/18/2020, 4:48 PMmvn clean install
, but had it compile and run from a Spring Boot configuration in Intellij? It works on 1.3.72, but not on 1.4.0. My 1.4.0 pom with just the version is linked: https://gist.github.com/csturtevant/e757a961344560d00ea08823a5cec3a1Jose A.
08/18/2020, 5:02 PMChristopher Elías
08/18/2020, 9:05 PMPublishSubject
from RxJava. Does anybody have a sample of how to achive this?basher
08/18/2020, 9:42 PMbasher
08/18/2020, 9:42 PMoscarg798
08/18/2020, 11:19 PMbasher
08/18/2020, 11:22 PMlouiscad
08/19/2020, 6:19 AMudalov
08/19/2020, 10:59 AM