lukas.mega
03/28/2018, 1:46 PMMarcin Wisniowski
03/28/2018, 3:28 PMif ((previous == null) or (previous.type == type)) {
IntelliJ complains about the dot here, why is previous
not smart-cast to not null if it's checked first?perryprog
03/28/2018, 3:50 PMnish
03/28/2018, 4:01 PMShawn
03/28/2018, 4:13 PMursus
03/28/2018, 7:24 PMclass Foo {
Foo(String unhashedPassword) {
this.hashedPassword = HashUtils.sha1(unhashedPassword)
}
}
pakoito
03/28/2018, 11:01 PMhasReceiver()
and receiverType
. Not receiverTypeId
, which seems to be something unrelated ¯\_(ツ)_/¯jw
03/29/2018, 2:06 AMmiszmaniac
03/29/2018, 7:20 AMconst val CONFIG_FILE_NAME = "config.json"
alex
03/29/2018, 9:18 AMiex
03/29/2018, 11:43 AMAdrian M
03/29/2018, 12:53 PMFedor Bobin
03/30/2018, 7:19 AMhttpClient.get<Type>(...): Type <------ return type is handled from reified generic parameter
interface JsonSerializer {
suspend fun read(type: KClass<*>, content: IncomingContent): Any <<------ and handled type is used to instantiate object
}
If I pass List<MyObject> as a type parameter, I silently get List of garbage because reified generics does not include inner parameters and only List<*> will be passed to JsonSerializer.read(...)
I am wonder why not:
1) either: do not allow to pass classes with inner generics to reified methods
2) or: pass something different then just KClass that supports chain of genericsmp
03/30/2018, 10:35 AMinterface Archievable {
val status: ArchievedStatus
}
enum class ArchievedStatus { NEW, READY,ARCHIVED}
///and then
data calss User(val blabla, override val status: ArchievedStatus): Archievable
data calss Company(val blabla, override val status: ArchievedStatus): Archievable
///with definition of archiving i wan't to create single method that use copy method and work with 2 pojos
and don't want lose copy
form data class but use it to update entitiesDaniel
03/30/2018, 12:40 PMlistOf("a", "b", "c") + listOf("d", "e") = listOf("a", "d", "b", "e", c")
clubfan
03/30/2018, 12:41 PMar-g
03/30/2018, 5:00 PMdims
03/30/2018, 9:26 PMHamza
03/31/2018, 3:30 PMHamza
03/31/2018, 3:37 PMjinbeom hong
04/01/2018, 3:01 PM// source code
fun main(args: Array<String>) {
val value: Int
value = 3
}
// REPL
>>> val value: Int
error: property must be initialized or be abstract
val value: Int
Slackbot
04/01/2018, 10:09 PMribesg
04/02/2018, 12:31 AMmyMutableMap.values.removeAll { <predicate> }
Will this remove entries from the map?rogerjohns
04/02/2018, 7:52 AMLilja
04/02/2018, 10:16 AMnull
, 1
, 2
and so on. It's named condition
. I have a list, listOf(1,2,3,4)
. That's named stream
. Based of on condition
I would like to filter
for stream
, but only if it's non-null
. How can I perform a filter
operation if a condition either is null
or a value? if(condition != null) stream.filter(it == condition) else stream
is one solution I suppose but is there a cleaner way?nil2l
04/02/2018, 10:19 AMstream.filter { condition == null || it == condition }
tipsy
04/02/2018, 11:05 AMndkoval
04/02/2018, 1:10 PMNo class roots are found in the JDK path: /home/nkoval/jdk10-consol-proto/build/linux-x86_64-normal-server-release/jdk
I run it on Ubuntu and for Java projects it works well.Clayton Walker
04/02/2018, 10:04 PMClayton Walker
04/02/2018, 10:12 PMClayton Walker
04/02/2018, 10:12 PMgildor
04/02/2018, 11:49 PM