Olekss
12/22/2017, 7:44 AMkarelpeeters
12/22/2017, 7:53 AMchb0kotlin
12/22/2017, 5:58 PMclass CompositeReader(private var readers: List<Reader> = listOf()) : Reader() {
override fun close() = readers.forEach(Reader::close)
override fun read(cbuf: CharArray?, off: Int, len: Int): Int {
var result = -1
if (readers.isNotEmpty()) {
result = readers.first().read(cbuf, off, len)
if (result == -1) {
readers = readers.subList(1, readers.lastIndex)
if (readers.isNotEmpty()) {
result = readers.first().read(cbuf, off, len)
}
}
}
return result
}
fun copy(reader: Reader) = CompositeReader(readers = this.readers + reader)
}
karelpeeters
12/22/2017, 9:20 PMstkent
12/23/2017, 3:55 AM.withDefault
on a map, the default behavior seems to be lost if I call another method (e.g. toMutableMap
) on that map instance. Is that expected/documented behavior? I couldn't find clear rules in the docs.evanchooly
12/23/2017, 9:01 PMY
jsparn
12/23/2017, 11:38 PMvar digitArray: MutableList<MutableList>
jkbbwr
12/24/2017, 12:30 AMval converters = mutableMapOf<Class<*>, Load<*>>()
karelpeeters
12/24/2017, 9:44 AMComparator.naturalOrder<Message>()
ferrytan
12/24/2017, 5:31 PMdSebastien
12/25/2017, 11:11 PMdSebastien
12/26/2017, 12:17 AMmike_shysh
12/26/2017, 9:19 AMmike_shysh
12/26/2017, 3:55 PMparams={"currency_info":{"iso_4217":"CAD","name":"Canadian Dollar","imerchantAccount":0,"ixrateSource":2}}
instead if
params={"currency_info":{"iso_4217":"CAD","name":"Canadian Dollar","i_merchant_account":0,"i_xrate_source":2}}
Here is the data class
data class CurrencyInfo(
@JsonProperty("currency_info") val currencyInfo: CurrencyInfoItem?
)
@JsonInclude(JsonInclude.Include.NON_NULL)
data class CurrencyInfoItem(
@JsonProperty("iso_4217") val iso4217: String?,
@JsonProperty("name") val name: String?,
@JsonProperty("name_major") val nameMajor: String?,
@JsonProperty("name_minor") val nameMinor: String?,
@JsonProperty("i_ma_currency") val iMaCurrency: Int?,
@JsonProperty("i_merchant_account") val iMerchantAccount: Int?,
@JsonProperty("i_x_rate_source") val iXRateSource: Int?,
@JsonProperty("base_units") val baseUnits: Double?,
@JsonProperty("min_allowed_payment") val minAllowedPayment: Int?,
@JsonProperty("decimal_digits") val decimalDigits: Int?,
@JsonProperty("is_used") val isUsed: Boolean?
)
karelpeeters
12/26/2017, 4:18 PMbuildSequence(::getThingBlocking).forEach { ... }
lewik
12/26/2017, 7:43 PMAn exception occurs during Evaluate Expression Action : Back-end (JVM) Internal error: No implClassName for public expect fun kotlin.Array<out kotlin.Byte>.toByteArray(): kotlin.ByteArray defined in kotlin.collections[DeserializedSimpleFunctionDescriptor...
exception?
In public expect fun Array<out Byte>.toByteArray(): ByteArray
called on Byte[] size 78groostav
12/27/2017, 7:01 AMC:\Users\Geoff\.IntelliJIdea2017.3\config\plugins\Kotlin
deleting files and copying them over from the zip for 1.1.60 downloaded on the archives https://plugins.jetbrains.com/plugin/6954-kotlinErfan
12/27/2017, 2:57 PMirus
12/27/2017, 3:07 PMinline fun <reified T : Any?> sample() {
println("Is nullable: ${isNullable<T>()}")
}
inline fun <reified T : Any?> isNullable(): Boolean {
return try {
null as T
true
} catch (e: Exception) {
false
}
}
fun main(args: Array<String>) {
sample<String?>()
sample<String>()
}
herlevsen
12/27/2017, 4:42 PMmike_shysh
12/27/2017, 5:34 PMdataIds.put(cc.customerClassInfo?.name, ccResponse.iCustomerClass)
qwert_ukg
12/28/2017, 7:19 AMaltmind
12/28/2017, 11:57 AMmike_shysh
12/28/2017, 12:15 PMopen class BaseTest {
lateinit var testDataConst: MutableMap<String?,Int?>
@BeforeSuite
fun setup() {
testDataConst = prepareBaseData(conf[system.user],conf[system.password])
println(testDataConst) <<< here testDataConst is initialized
}
But in Test class testDataConst is uninitialized
class AddCustomer : BaseTest() {
@ Test
fun addCustomer() {
println(testDataConst) <<< Here it is an error
}
}
How could I solve it?rkeazor
12/28/2017, 5:39 PMbod
12/28/2017, 6:00 PMgroostav
12/29/2017, 2:00 AMnil2l
12/29/2017, 10:15 AMkotlin.reflect.jvm.internal.KotlinReflectionInternalError: Introspecting local functions, lambdas, anonymous functions and local variables is not yet fully supported in Kotlin reflection
In function toString()
of a data class.
The data class contains a lambda.
Do I need to override toString()
to exclude the lambda? Or lambdas are not allowed in data classes at all?Roberto Fernandez
12/29/2017, 12:44 PMprotected Class getPrototypeClass(T content) {
With this code
override fun getPrototypeClass(content: AlfredElement): Class<*> {
return when (content) {
is Category -> AlfredCategoryRenderer::class.java
is Suggestion -> AlfredSuggestionElement::class.java
}
}
And AlfredCategoryRenderer is a class with this type
: Renderer<AlfredElement>()
So, how can i tell kotlin compiler something like i can do i java which is tell the method getPrototypeClass will return a class that is Something like extends AlfredElement?Andreas Sinz
12/29/2017, 1:17 PMAndreas Sinz
12/29/2017, 1:17 PMmarcinmoskala
12/29/2017, 2:03 PMClass<? extends Renderer>
Andreas Sinz
12/29/2017, 2:35 PMRoberto Fernandez
12/29/2017, 3:07 PM