strange, I've never had problems with it. It's normal that you have to clean up the generated Kotlin code (mostly the nullability) afterwards, but if it produces incorrect code, that's clearly a bug. Maybe it's because one of your parameters is called
val
and that's a keyword in Kotlin??
It should look something like this:
• first code snippet
model.searchTextProperty().addListener( Listener { obs, old, value -> // you might need to add the types!? Also I assume the the type of the Listener that addListener takes is "Listener", adapt if different
val isEmpty = value.isNullOrBlank()
pseudoClasStateChanged(FILTERED, !isEmpty)
navMenu.predicate = if(isEmpty) {
PREDICATE_ANY
} else {
Predicate { region: Region -> region is NavLink && region.matches(value) } // region is smart-casted to NavLink for the second part of the expression
}
})
• second part, the setter
var predicate: Predicate<Region>
set(regionPredicate) {
content.predicate = regionPredicate
}