[FE] Add language feature for context receivers

This commit is contained in:
Anastasiya Shadrina
2021-09-16 17:13:13 +07:00
committed by TeamCityServer
parent 369c86ebb0
commit 910660a083
91 changed files with 222 additions and 3 deletions
@@ -1,4 +1,6 @@
// !LANGUAGE: +ContextReceivers
// FIR_IDENTICAL
class File(name: String)
interface InputStream
@@ -1,3 +1,4 @@
// !LANGUAGE: +ContextReceivers
// FIR_IDENTICAL
interface Canvas
@@ -1,3 +1,4 @@
// !LANGUAGE: +ContextReceivers
// FIR_IDENTICAL
class Button
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
data class Pair<A, B>(val first: A, val second: B)
context(Comparator<T>)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
data class Pair<A, B>(val first: A, val second: B)
context(Comparator<T>)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class View
context(View) val Int.dp get() = 42 * this
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class View
context(View) val Int.dp get() = 42 * this
@@ -1,3 +1,4 @@
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
class Context
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
typealias IterableClass<C, T> = (C) -> Iterator<T>
context(IterableClass<C, T>)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
typealias IterableClass<C, T> = (C) -> Iterator<T>
context(IterableClass<C, T>)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class JSONObject {
fun build(): JSONObject = TODO()
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class JSONObject {
fun build(): JSONObject = TODO()
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
interface Params
interface Logger {
fun info(message: String)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
interface Params
interface Logger {
fun info(message: String)
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
interface Semigroup<T> {
infix fun T.combine(other: T): T
}
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
interface Semigroup<T> {
infix fun T.combine(other: T): T
}
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class Session(var lastAccess: Any?)
interface Transaction {
fun loadSession(): Session
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class Session(var lastAccess: Any?)
interface Transaction {
fun loadSession(): Session
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class Storage<T> {
inner class Info
@@ -1,3 +1,5 @@
// !LANGUAGE: +ContextReceivers
class Storage<T> {
inner class Info