``` @ExperimentalContracts fun hasChildren(region:...
# codingconventions
b
Copy code
@ExperimentalContracts
fun hasChildren(region: Region): Boolean {
   contract {
       returns(true) implies (region.regions != null)
   }
   return regions?.isNotEmpty() ?: false
}
Not sure why this doesn’t work.. Smart contracts only works with values passed as parameters?
b
It's because of regions being a property. That property has an accessor method that is called and could evaluate to something different on consecutive access