GauthierPLM
12/14/2017, 8:42 AMlovis
12/14/2017, 8:50 AMclass CreateUserDTO(
@Email @get:Email @setparam:Email
var email: String
)
?
I mean, isnt't there a way to combine these things? When I annotate the constructor param, I usually also want to annotate the getter and setter, right?diesieben07
12/14/2017, 10:08 AMnull
for the "vararg array". Is there a way to do that in Kotlin? null as Array<String>?
does not work.jstuyts-squins
12/14/2017, 10:09 AMclass RequiredData(val firstField: String, val secondField: String)
interface SomeDataProvider {
fun provide(): RequiredData
}
kartikpatodi
12/14/2017, 10:37 AMAssertions.assertThat()
can be called like
someFun()
is it possible?damian
12/14/2017, 3:20 PMwhen
on an instance of SpecificExceptions
the auto-completion for all branches at least doesn’t workkarelpeeters
12/14/2017, 4:43 PManstaendig
12/14/2017, 4:58 PMchansek
12/14/2017, 5:39 PMeygraber
12/14/2017, 9:00 PMrrader
12/15/2017, 8:23 AMrrader
12/15/2017, 8:39 AMobject
should extend a base class or implement an interface, can please someone show real use case when we need on object that extend a base class or implement an interface?jstuyts-squins
12/15/2017, 9:01 AMnull
objects in a lot of cases. For example:
object NoOperationMouseListener : MouseListener {
...
}
The mouse listener member of your class does not have to be nullable in this case:
class MouseEventEmittingClass {
var mouseListener: MouseListener = NoOperationMouseListener
}
natpryce
12/15/2017, 9:55 AMmc
12/15/2017, 1:24 PMjava.util.Optional
in kotlin to be idiomatic (given the built-in nullable types feature)?rrader
12/15/2017, 1:43 PMjw
12/15/2017, 5:22 PMAndreas Sinz
12/15/2017, 5:28 PMfilterNotNull()
orangy
12/15/2017, 5:35 PMczyzby
12/15/2017, 8:05 PMchristophsturm
12/15/2017, 8:30 PMkevinmost
12/15/2017, 9:00 PMFoo::myMember.annotations
jtonic
12/15/2017, 9:54 PMtipsy
12/16/2017, 11:18 AM/**
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.maxBy(selector: (T) -> R): T? {
karelpeeters
12/16/2017, 8:11 PMUnit
is not like void
at all, it's just an ordinary singleton object.Kris
12/16/2017, 9:03 PMshamrock_frost
12/17/2017, 3:42 AMis
clauses of a when(x)
statement?Shawn
12/17/2017, 5:38 AMjtonic
12/17/2017, 2:21 PMclass A {
companion object {
const val name1 = "Antonel"
const val name2 = StringBuilder("Antonel")
}
}
error: const 'val' has type 'kotlin.text.StringBuilder /* = java.lang.StringBuilder */'. Only primitives and String are allowed
Antonel.czyzby
12/17/2017, 4:35 PMorg.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'addTooltip' into
@org.junit.Test public final fun `should add Tooltip with init block`(): kotlin.Unit defined in ktx.scene2d.TooltipFactoriesTest
(...)
Cause: addTooltip$default (Lcom/badlogic/gdx/scenes/scene2d/Actor;Ljava/lang/String;Lcom/badlogic/gdx/scenes/scene2d/ui/Skin;Lcom/badlogic/gdx/scenes/scene2d/ui/TooltipManager;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lcom/badlogic/gdx/scenes/scene2d/ui/Tooltip;:
@Lorg/jetbrains/annotations/NotNull;() // invisible
(...)
The root cause was thrown at: SMAPAndMethodNode.kt:38
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.throwCompilationException(InlineCodegen.kt:132)
czyzby
12/17/2017, 4:35 PMorg.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'addTooltip' into
@org.junit.Test public final fun `should add Tooltip with init block`(): kotlin.Unit defined in ktx.scene2d.TooltipFactoriesTest
(...)
Cause: addTooltip$default (Lcom/badlogic/gdx/scenes/scene2d/Actor;Ljava/lang/String;Lcom/badlogic/gdx/scenes/scene2d/ui/Skin;Lcom/badlogic/gdx/scenes/scene2d/ui/TooltipManager;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lcom/badlogic/gdx/scenes/scene2d/ui/Tooltip;:
@Lorg/jetbrains/annotations/NotNull;() // invisible
(...)
The root cause was thrown at: SMAPAndMethodNode.kt:38
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.throwCompilationException(InlineCodegen.kt:132)
louiscad
12/17/2017, 8:31 PMczyzby
12/17/2017, 8:49 PMinline
keyword, the function works as expected.louiscad
12/17/2017, 9:19 PMilya.gorbunov
12/18/2017, 3:33 AMczyzby
12/18/2017, 7:15 AMlouiscad
12/18/2017, 8:37 AM