[Tests] Make build green again
This commit is contained in:
committed by
TeamCityServer
parent
98e84a926a
commit
c59ed6344e
+5
@@ -0,0 +1,5 @@
|
||||
fun <T> f(t: @ContextFunctionTypeParams(42) T, tt: @ContextFunctionTypeParams(1) Int) {}
|
||||
|
||||
fun test() {
|
||||
val f: @ContextFunctionTypeParams(1) @ExtensionFunctionType (Int, String) -> Unit = {}
|
||||
}
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
fun <T> f(t: <!UNSUPPORTED_FEATURE!>@ContextFunctionTypeParams(42)<!> T, tt: <!UNSUPPORTED_FEATURE!>@ContextFunctionTypeParams(1)<!> Int) {}
|
||||
|
||||
fun test() {
|
||||
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// !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) { 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
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// FIR_IDENTICAL
|
||||
|
||||
class File(name: String)
|
||||
interface InputStream
|
||||
|
||||
Reference in New Issue
Block a user