What is the difference between a Property and Open Property in Kotlin? The code below complains on me declaring the setter private and Intellij says private setters are not allowed for open properties. What is an open property?
@RestController
open class ParameterController {
@Autowired
lateinit var parameterRepository: ParameterRepository
private set //error
}
为什么上面的代码无效,而这个代码无效?
open class ItemPrice{
lateinit var type: String
private set // ok
}
EDIT: I am using the spring-allopen plugin, and marking the class explicitly as open doesn't make a difference.