AndreasBackx
03/12/2019, 6:48 PMexceptionally {
it.printStackTrace()
}
But it complains Type mismatch. Required: Void! Found: Unit
. Shouldn't have Kotlin handled this properly or am I missing something?AndreasBackx
03/12/2019, 7:03 PMreturn null
, which should comply to the error as it's Void!
then it complains that null is not a non-null type of Unit as it expects in Kotlin. So what is it Kotlin, a Void!
or a Unit
?Shawn
03/12/2019, 7:08 PMreturn null
within the lambda?Shawn
03/12/2019, 7:08 PMShawn
03/12/2019, 7:09 PMCompletableFuture<Void>().exceptionally {
it.printStackTrace()
null
}
AndreasBackx
03/12/2019, 7:09 PMShawn
03/12/2019, 7:09 PMAndreasBackx
03/12/2019, 7:09 PMAndreasBackx
03/12/2019, 7:10 PMAndreasBackx
03/12/2019, 7:10 PMShawn
03/12/2019, 7:11 PMjava.lang.Void
has been a compatibility sore spot for a while now, because there apparently isn’t an obvious way for kotlinc
to cleanly map it to Unit, it seems, or at least, not in all instancesAndreasBackx
03/12/2019, 7:12 PMShawn
03/12/2019, 7:12 PMShawn
03/12/2019, 7:12 PMAndreasBackx
03/12/2019, 7:13 PMgildor
03/12/2019, 11:11 PM