LeoColman
09/11/2018, 2:38 AMnapperley
09/11/2018, 6:38 AMAlbert
09/11/2018, 11:19 AM!!
andyb
09/11/2018, 1:05 PMvar
where the variable may have been modified between the check for not null & it’s usageAlbert
09/11/2018, 1:33 PMval
on a class.
example(someClass: SomeClass) {
if (someClass.nullableField == null) {
throw SomeSpecificException()
}
}
lookUp(someClass.nullableField!!)
The example might be weird, but I need this for an application to throw specific exceptions when this occurs.
Assigning it to a local val
will fix this, but this is only to demonstrateDico
09/12/2018, 5:41 AMval
to only read the property one time. For example:
val nullableField = nullableField ?: throw SomeSpecificException()
Бежан Александр
09/14/2018, 9:41 AM