Kotlin DSL: javadoc failOnError

I have a simple problem and I obviously don’t known enough about Kotlin to make it work. How do I set javadoc’s failOnError to false in my build with Kotlin?

tasks {
    javadoc {
        title = "Foobar" // This works
        failOnError = false // This doesn't

I guess it has something to do with Kotlin, boolean and “(is)FailOnError” as getter?

Finally, this is how it works:

tasks.withType<Javadoc> {
    isFailOnError = false