Daniele Segato
09/11/2018, 9:10 PMinline
, noinline
, crossinline
?pawel.urban
09/12/2018, 9:43 AMSomeClass<X>
and SomeClass<X?>
at once?Hamza
09/12/2018, 10:20 AMpawel.urban
09/12/2018, 11:38 AMfun doSomething(input: SomeClass<Concrete?>)
.
Use case is:
val localInstance: SomeClass<Concrete> = ...
doSomething(localInstance)
Should I naively cast local instance to localInstance as SomeClass<Concrete?>
to use this method? Assume that I can’t change the method.karelpeeters
09/12/2018, 4:54 PMtypealias
is that it doesn't offer any type safety. For example, say I'm packing a 2D coordinate of `Int`s in a Long
, I don't want the Long
value to ever be interpreted as a number nor the other way around.ianbrandt
09/12/2018, 5:20 PMDias
09/12/2018, 8:11 PMkarelpeeters
09/12/2018, 8:30 PMMcEna
09/12/2018, 8:39 PMMcEna
09/12/2018, 8:51 PMMcEna
09/12/2018, 9:10 PMAndreas Sinz
09/12/2018, 9:16 PMfun main(args: Array<String>) {
val foo = object {
var foo: Int? = null
}
foo.foo = 5
println(foo.foo) //Yields Smart cast impossible, because foo.foo is a mutable property ...
}
tateisu
09/12/2018, 10:36 PMgildor
09/13/2018, 6:34 AMif(obj != null)
is not bad itself
Maybe you could show to your team members good examples how to eliminate nullability in particular casesMcEna
09/13/2018, 6:40 AMorangy
Result
is now prohibited for use as a return type by compilerjmfayard
09/13/2018, 12:50 PMtoString()
implementation of `object`s inside a sealed class
? ^^robstoll
09/13/2018, 3:37 PMwhen
when it is not exhaustive other than using it as expression (e.g. assign it to a variable)?jw
09/13/2018, 3:39 PMRuckus
09/13/2018, 4:26 PMvaskir
09/13/2018, 4:55 PMtipsy
09/13/2018, 5:42 PMinline fun <reified T : Any> getAs(noinline converter: ((String) -> Any)? = null): T = ...
v79
09/13/2018, 6:26 PMwhen
in my main code. This is just in a test class. I am just surprised the compiler was understanding that result
must be a Post
just because post
is from a cast. Especially is it is possible for my function to return a PostGeneration.Error
or a <http://PostGeneration.Post|PostGeneration.Post>
. I'm going to write a test case which should return a PostGeneration.Error
and see what happens...Hullaballoonatic
09/13/2018, 11:02 PMisNullOrEmpty()
not just an extension property so that the () are unnecessary? so that they can be overloaded? I usually create extensions for readabilitybloodshura
09/13/2018, 11:45 PMxenoterracide
09/14/2018, 12:30 AMErrorProneOptions.class
doesn't appear to be available to me in java. Why? can I remediate?dhananjaykulkarni19
09/14/2018, 6:14 AMSlackbot
09/14/2018, 8:59 AMБежан Александр
09/14/2018, 9:36 AMflatMap
in Kotlin. How to do that ?
For example:
val coll: List<Set<Int>> = ...
coll.flatMap{set -> setOf(set, set + 1)}
pniederw
09/14/2018, 9:50 AM