muralimohan962
10/31/2018, 6:31 AMfebs
10/31/2018, 8:46 AMfebs
10/31/2018, 9:07 AMsannysoft
10/31/2018, 10:07 AMigor.wojda
10/31/2018, 11:09 AMlist
contains items with the same value (we don’t know what value it may be). Is there any operator or combination fo operators to achieve this ?
eg `
listOf("A", "A", "A") //true
listOf("A", "A", "B") //false
`
buremba
10/31/2018, 11:54 AMOperator<*>
. Jackson automatically parse the string into the appropriate class for that Operator so we're sure that it will work. What's the alternative approach to this use-case in Kotlin?hudsonb
10/31/2018, 11:55 AMAPXEOLOG
10/31/2018, 12:47 PMabstract class Behavior<T> {
fun getData(entity: Entity): T {
return entity.getData(T::class)
}
}
Got Cannot use T as reified type parameter
stevecstian
10/31/2018, 1:11 PMrnathani
10/31/2018, 1:12 PMNikita Khlebushkin
10/31/2018, 2:27 PMEgor Trutenko
10/31/2018, 2:30 PMTom Adam
10/31/2018, 3:04 PMkarelpeeters
10/31/2018, 9:14 PM!!
and a setter that accepts null?Hamza
11/01/2018, 12:42 AMHamza
11/01/2018, 12:43 AMHamza
11/01/2018, 12:44 AMMark
11/01/2018, 2:10 AMsequence {}
but getting “Restricted suspending functions can only invoke member or extension suspending functions on their restricted coroutine scope”. I can’t seem to find any information about this. Any pointers please? https://pl.kotl.in/B1hRgy_2m Presumably I need to use a suspending extension function of CoroutineScope?Hamza
11/01/2018, 2:56 AM/** Subtracts the other value from this value. */
public operator fun minus(other: Byte): Int
Note: This is inside the byte class.gildor
11/01/2018, 10:46 AMBernhard
11/01/2018, 1:38 PMSpike Baylor
11/01/2018, 2:16 PMby cssclass()
is that really just a wrapper around some sort of lazy type opperation?Nikky
11/01/2018, 3:44 PMthanksforallthefish
11/01/2018, 4:13 PMtoString
does not seem consistent (given my understanding that inline classes are substituted with their member)
given
inline class ProjectUid(val projectUid: String)
println(ProjectUid("test"))
the output is ProjectUid(projectUid=test)
, I would have expected only test
. This "breaks" some libraries (simple workaround is to inline myself)
am I misundersting something? is this behavior expected?Spike Baylor
11/01/2018, 5:58 PMmarcelo
11/01/2018, 6:59 PMmetrics.timer(timerName, successTag).time {
throw IllegalArgumentException("Stop")`
GarouDan
11/01/2018, 11:31 PM@Bean("MyBean") // works, but
@Bean(MyBean::class.simplaname) // don't work, since the annotation says something like `An annotation argument must be a compile-time constant`
Is there a way to contour this? Since the annotation will be compile-time constant to me.
I would like do something like these to create a lot of dynamic values when using annotation classes.Ovsyannikov Alexey
11/02/2018, 1:25 AMBroadcastChannel
? Now it is marked as experimental
Shawn
11/02/2018, 2:32 AMHamza
11/02/2018, 4:59 AM@UseExperimental(ExperimentalContracts::class)
fun anyNotNull(vararg arguments: Any?, block: () -> Unit): Boolean {
contract {
returns(true) implies /* Something here that tells the compiler that all arguments are not null */
}
if(arguments.any { it == null }) {
block()
return false
}
return true
}
Hamza
11/02/2018, 4:59 AM@UseExperimental(ExperimentalContracts::class)
fun anyNotNull(vararg arguments: Any?, block: () -> Unit): Boolean {
contract {
returns(true) implies /* Something here that tells the compiler that all arguments are not null */
}
if(arguments.any { it == null }) {
block()
return false
}
return true
}
gildor
11/02/2018, 5:06 AMHamza
11/02/2018, 5:06 AMinline fun anyNotNull(vararg arguments: String?, block: () -> Unit) {
if(arguments.any { !isNotNull(it) }) {
block()
}
}
@UseExperimental(ExperimentalContracts::class)
fun isNotNull(arg: String?): Boolean {
contract {
returns(true) implies (arg != null)
}
return arg != null
}
gildor
11/02/2018, 5:18 AMHamza
11/02/2018, 5:18 AM