amadeu01
03/01/2019, 12:54 PM-Xallow-result-return-type
but seems not work with the play.kotlin. Has anyone tried it before?amadeu01
03/01/2019, 12:56 PMelect
03/01/2019, 1:18 PMThe error message could be clearer to say "only classes without generic parameters are allowed on the left side of ::"
ArrayList<*>::class
changes nothing thoughelect
03/01/2019, 1:19 PMArray<VkCommandBuffer>::class
works flawlessgavvvr
03/01/2019, 3:39 PMjava
extension in kotlin source root. Same for Groovyfred.deschenes
03/01/2019, 4:04 PMlaimiux
03/01/2019, 6:41 PMonClick
instead of onClick()
when val onClick: () -> Unit
?dimsuz
03/01/2019, 8:00 PMsrc/main/main.kt
. I'm talking about this. Cited this part in linked post abovedrofwarcs
03/01/2019, 8:51 PMfun doBar(callBack: (String, Array<Int>) -> Unit)
. That gets exposed to Java as
doBar(Function2<? super String, ? super Integer[], Unit> callback)
. When ever we try to create a anonymous class of Function2 we get doBar(Function2<? super String, ? super Integer[], Unit> callback) cannot be applied to (anonymous Function2< String, Integer[], Unit>)
. Is there another way to call a kotlin function interface from Java?kd
03/01/2019, 9:21 PMtoList
method but it does not seem to work.
Context: I am trying to implement a simple recycler view and update it using DiffUtil, but the oldList and newList are the same for some reasonobobo
03/01/2019, 10:03 PMfun MyObject.get(str: String): String {
return get(str) {}
}
class Scope {
operator fun Any.get(str: String): Int = 1
}
// within method body
val myObject = MyObject()
val scope = Scope()
with(scope) {
myObject.get("abc") // calls Scope's get()
}
How do I tell the compiler to call MyObject.get()? Suppose that both extension functions are define din libraries, so I can't easily change those names.Andrew Gazelka
03/02/2019, 12:42 AMassert
dead? From what I see on Google it isn't even enabled by default in junit unit tests afaikaoriani
03/02/2019, 1:03 AMQuang Luong
03/02/2019, 12:19 PMjava
import org.graalvm.polyglot.Context;
class Scratch {
public class Response {
public int x = 2;
}
void run () {
Context context = Context.create();
Response r = new Response();
context.getBindings("js").putMember("r", r);
context.eval("js", "r.x = 42");
System.out.println(r.x); // print 42
}
public static void main(String[] args) {
new Scratch().run();
}
}
Jakub Aniola
03/02/2019, 12:51 PMAndrew Gazelka
03/03/2019, 7:15 PMHullaballoonatic
03/03/2019, 8:43 PMsubject.verb(object)
. I personally hate syntax like python's len(list)
, because I feel like as a property of the list, it should be called as list.len
, and that len(list)
implies some kind of transformation of list
CRamsan
03/04/2019, 3:29 AMdamian
03/04/2019, 12:45 PMMyClass::class.simpleName
is of String?
type?
Why is it not String
?user
03/04/2019, 3:10 PMLeoColman
03/04/2019, 6:34 PMClass.forName("myClass").declaredMethods.map { it.kotlinFunction!! }.filter { fn -> fn.parameters.any { it is KFunction<*> } }
but it didn't workelect
03/04/2019, 6:43 PMassociatedWithTo
on Enum.values()
(Array<T>
)?
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-with-to.htmlKris Elsinga
03/04/2019, 7:42 PMDavide Giuseppe Farella
03/05/2019, 2:59 AMAny
?
Let’s say that I got this class and I want the better way for ensure that image
is Drawable, Int, Bitmap, File, String or Uri
and placeholder is Drawable, Int, Bitmap or File
without crashing at runtimeRené
03/05/2019, 7:47 AMOscar Torreno
03/05/2019, 9:40 AMSlackbot
03/05/2019, 2:11 PMPaul Woitaschek
03/05/2019, 2:48 PMefemoney
03/05/2019, 3:04 PMMatthew Hall
03/05/2019, 5:06 PMMatthew Hall
03/05/2019, 5:06 PMkarelpeeters
03/05/2019, 5:19 PMMatthew Hall
03/05/2019, 5:37 PM