Was trying Koans online task #32 - Properties, when pressing “check” the results never returned, “error : Internal Server Error” is shown
Do you mean this task? Kotlin Playground: Edit, Run, Share Kotlin Code Online
I’ve tried to reproduce it and got another problem (pressing “Check” button doesn’t show the result of test the first time), but nothing close to Internal Server Error.
Does it still happen?
Your code is invalid. It will cause a stack overflow (the setter recursively calls itself). You should use the field
identifier to access the property’s storage.
var propertyWithCounter: Int? = null
set(value:Int?) {
counter++
field = value
}
Given this, the error message is not helpful. Something that provides better diagnostics would be very helpful.
It works now, thanks for helping