[FIR] Adapt positioning of NO_VALUE_FOR_PARAMETER to match K1

This commit is contained in:
Kirill Rakhman
2023-06-23 13:05:49 +02:00
committed by Space Team
parent 6d1d6e48c1
commit 5abab2197b
42 changed files with 70 additions and 194 deletions
@@ -19,7 +19,7 @@ class A
infix operator fun A.plus(a : Any) {
1.foo()
true.<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>foo()<!>
true.foo<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>()<!>
1
}
@@ -16,7 +16,7 @@ class C : T {
super.foo() // OK
super.<!UNRESOLVED_REFERENCE!>bar<!>() // Error
super.buzz() // OK, resolved to a member
super.<!NO_VALUE_FOR_PARAMETER!>buzz1()<!> // Resolved to an extension
super.buzz1<!NO_VALUE_FOR_PARAMETER!>()<!> // Resolved to an extension
super.buzz1(<!ARGUMENT_TYPE_MISMATCH!>""<!>) // Resolved to a member
}
}
@@ -1,34 +0,0 @@
// !LANGUAGE: +ContextReceivers
class File(name: String)
interface InputStream
interface AutoCloseScope {
fun defer(closeBlock: () -> Unit)
fun close()
}
class AutoCloseScopeImpl : AutoCloseScope {
override fun defer(closeBlock: () -> Unit) = TODO()
override fun close() = TODO()
}
context(AutoCloseScope)
fun File.open(): InputStream = TODO()
fun withAutoClose(block: context(AutoCloseScope) () -> Unit) {
val scope = AutoCloseScopeImpl() // Not shown here
try {
with(scope) { <!NO_VALUE_FOR_PARAMETER!>block()<!> }
} finally {
scope.close()
}
}
fun test() {
withAutoClose {
val input = File("input.txt").open()
val config = File("config.txt").open()
// Work
// All files are closed at the end
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
class File(name: String)