In the section: Properties and fields of the kotlin link, the following examples are written:
var allByDefault: Int? // error: explicit initializer required, default gate and installer implied
However, I am testing the code, and there is no error compiling and running it. Here is my code "
fun main(args:Array<String>){ var allByDefault:Int? }
So why the documentation says:
error: explicit initializer required, default getter and setter implied
I searched Google for help, but did not find a result that could help me.
@toniedzwiedz's answer solved the problem. It's my fault. I accept a property and a variable.
source share