Implemented 'lateinit' properties

If property is lateinit, then on each access we need to test its value
and throw UninitializedPropertyAccessException if it is null.
This commit is contained in:
Igor Chevdar
2017-03-21 16:38:30 +03:00
parent e170edac17
commit 55d3b23cfe
5 changed files with 90 additions and 15 deletions
@@ -24,6 +24,10 @@ fun ThrowNoWhenBranchMatchedException(): Nothing {
throw NoWhenBranchMatchedException()
}
fun ThrowUninitializedPropertyAccessException(): Nothing {
throw UninitializedPropertyAccessException()
}
@ExportForCppRuntime
internal fun TheEmptyString() = ""
@@ -176,6 +176,15 @@ public open class NoWhenBranchMatchedException : RuntimeException {
}
}
public open class UninitializedPropertyAccessException : RuntimeException {
constructor() : super() {
}
constructor(s: String) : super(s) {
}
}
public open class OutOfMemoryError : Error {
constructor() : super() {