[LL FIR] add lazy resolve check to ensure that all nested declarations are resolved

This bow includes: value parameters, property accessors and class members;
before, only class members was checked
This commit is contained in:
Ilya Kirillov
2022-08-09 10:39:56 +02:00
parent 75787be2f8
commit 9f1ecdfaa1
16 changed files with 200 additions and 148 deletions
@@ -71,13 +71,13 @@ public inline fun buildErrorWithAttachment(
@OptIn(ExperimentalContracts::class)
public inline fun checkWithAttachmentBuilder(
value: Boolean,
lazyMessage: () -> String,
condition: Boolean,
message: () -> String,
buildAttachment: ExceptionAttachmentBuilder.() -> Unit = {}
) {
contract { returns() implies (value) }
contract { returns() implies (condition) }
if (!value) {
buildErrorWithAttachment(lazyMessage(), buildAttachment = buildAttachment)
if (!condition) {
buildErrorWithAttachment(message(), buildAttachment = buildAttachment)
}
}