david-wg2
08/13/2019, 8:30 AMif (pin?.length != 36) throw UnauthorizedResponse()
// pin is smart cast here
if (pin?.length !in (8..36)) throw UnauthorizedResponse()
// pin is not smart cast here
gildor
08/13/2019, 8:33 AMdavid-wg2
08/13/2019, 8:34 AMgildor
08/13/2019, 8:34 AMdavid-wg2
08/13/2019, 8:34 AMdavid-wg2
08/13/2019, 8:35 AMgildor
08/13/2019, 8:35 AMdavid-wg2
08/13/2019, 8:35 AMgildor
08/13/2019, 8:35 AMgildor
08/13/2019, 8:37 AMdavid-wg2
08/13/2019, 8:38 AMgildor
08/13/2019, 8:48 AMgildor
08/13/2019, 8:49 AMchristophsturm
08/13/2019, 8:53 AMKroppeb
08/13/2019, 1:07 PMKroppeb
08/13/2019, 2:01 PMprivate fun Int?.notInRange(range: IntRange): Boolean {
contract {
returns(false) implies (this@notInRange != null)
}
return this !in range
}
Kroppeb
08/13/2019, 2:05 PM