Kotlin DSL does not support assignment as you are attempting, you need to use the set method of the property.
myExt {
myStringProperty.set("test")
}
The assignment, myStringProperty = "test" is trying to set the value of the kotlin property/field instead of the value held by the Property instance, which is why you get an error saying it cannot assign a String to a Property.
The Groovy DSL supports magic that converts assignment to a set call.
Also; You most likely never want the Property instance to change in the extension and it should be final/read-only (val instead of var).
Actually, in 8.1 the assignment syntax will finally work also in Kotlin DSL.
Here the dogfood PR that makes Gradles own build use that already: https://github.com/gradle/gradle/pull/23547