?
The code below compiled and executed without issue before the addition of the line declaring errorStatus. Why does this line break the code?
The code below compiled and executed without issue before the addition of the line declaring errorStatus. Why does this line break the code?
sealed class Status(){
object Error : Status()
class Success : Status()
}
fun main(){
var successStatus = Status.Success()
var errorStatus = Status.Error()
}
sealed class Status(){
object Error : Status()
class Success : Status()
}
fun main(){
var successStatus = Status.Success()
var errorStatus = Status.Error()
}
Join the Discussion
Login to post a comment or share your explanation.
Login