[FE] Add language feature for context receivers
This commit is contained in:
committed by
TeamCityServer
parent
369c86ebb0
commit
910660a083
+2
@@ -1,4 +1,6 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// FIR_IDENTICAL
|
||||
|
||||
class File(name: String)
|
||||
interface InputStream
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// FIR_IDENTICAL
|
||||
|
||||
interface Canvas
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// FIR_IDENTICAL
|
||||
|
||||
class Button
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
data class Pair<A, B>(val first: A, val second: B)
|
||||
|
||||
context(Comparator<T>)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
data class Pair<A, B>(val first: A, val second: B)
|
||||
|
||||
context(Comparator<T>)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class View
|
||||
|
||||
context(View) val Int.dp get() = 42 * this
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class View
|
||||
|
||||
context(View) val Int.dp get() = 42 * this
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
|
||||
|
||||
class Context
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
typealias IterableClass<C, T> = (C) -> Iterator<T>
|
||||
|
||||
context(IterableClass<C, T>)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
typealias IterableClass<C, T> = (C) -> Iterator<T>
|
||||
|
||||
context(IterableClass<C, T>)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class JSONObject {
|
||||
fun build(): JSONObject = TODO()
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class JSONObject {
|
||||
fun build(): JSONObject = TODO()
|
||||
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
interface Params
|
||||
interface Logger {
|
||||
fun info(message: String)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
interface Params
|
||||
interface Logger {
|
||||
fun info(message: String)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
interface Semigroup<T> {
|
||||
infix fun T.combine(other: T): T
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
interface Semigroup<T> {
|
||||
infix fun T.combine(other: T): T
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class Session(var lastAccess: Any?)
|
||||
interface Transaction {
|
||||
fun loadSession(): Session
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class Session(var lastAccess: Any?)
|
||||
interface Transaction {
|
||||
fun loadSession(): Session
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class Storage<T> {
|
||||
inner class Info
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
class Storage<T> {
|
||||
inner class Info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user