[FE] Render context receivers for functions, properties, and classes
This commit is contained in:
committed by
TeamCityServer
parent
2954c5cc9c
commit
9e2271399e
@@ -168,6 +168,7 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator
|
|||||||
putTypeArguments(call.typeArguments) { it.toIrType() }
|
putTypeArguments(call.typeArguments) { it.toIrType() }
|
||||||
this.dispatchReceiver = dispatchReceiver?.load()
|
this.dispatchReceiver = dispatchReceiver?.load()
|
||||||
this.extensionReceiver = extensionReceiver?.load()
|
this.extensionReceiver = extensionReceiver?.load()
|
||||||
|
contextReceiversCount = contextReceivers.size
|
||||||
}
|
}
|
||||||
addParametersToCall(startOffset, endOffset, call, irCall, context.irBuiltIns.unitType, contextReceivers.map { it.load() })
|
addParametersToCall(startOffset, endOffset, call, irCall, context.irBuiltIns.unitType, contextReceivers.map { it.load() })
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public fun test.R.f(/*0*/ test.P1, /*1*/ test.P2): kotlin.Unit
|
context(test.C1, test.C2) public fun test.R.f(/*0*/ test.P1, /*1*/ test.P2): kotlin.Unit
|
||||||
|
|
||||||
public interface C1 {
|
public interface C1 {
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun supertypeContextual(): kotlin.Unit
|
context(Common) public fun supertypeContextual(): kotlin.Unit
|
||||||
public fun test(): kotlin.Unit
|
context(C1, C2) public fun test(): kotlin.Unit
|
||||||
public fun Common.supertypeExtension(): kotlin.Unit
|
public fun Common.supertypeExtension(): kotlin.Unit
|
||||||
public fun </*0*/ T : Common> T.supertypeExtensionGeneric(): kotlin.Unit
|
public fun </*0*/ T : Common> T.supertypeExtensionGeneric(): kotlin.Unit
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public fun withAutoClose(/*0*/ block: context(AutoCloseScope) () -> kotlin.Unit): kotlin.Unit
|
public fun withAutoClose(/*0*/ block: context(AutoCloseScope) () -> kotlin.Unit): kotlin.Unit
|
||||||
public fun File.open(): InputStream
|
context(AutoCloseScope) public fun File.open(): InputStream
|
||||||
|
|
||||||
public interface AutoCloseScope {
|
public interface AutoCloseScope {
|
||||||
public abstract fun close(): kotlin.Unit
|
public abstract fun close(): kotlin.Unit
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ public interface Canvas {
|
|||||||
|
|
||||||
public final class Circle : Shape {
|
public final class Circle : Shape {
|
||||||
public constructor Circle()
|
public constructor Circle()
|
||||||
public open override /*1*/ fun draw(): kotlin.Unit
|
context(Canvas) public open override /*1*/ fun draw(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
@@ -24,7 +24,7 @@ public object MyCanvas : Canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface Shape {
|
public interface Shape {
|
||||||
public abstract fun draw(): kotlin.Unit
|
context(Canvas) public abstract fun draw(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val </*0*/ T> Pair<T, T>.max: T
|
context(kotlin.Comparator<T> /* = java.util.Comparator<T> */) public val </*0*/ T> Pair<T, T>.max: T
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public infix operator fun </*0*/ T> T.compareTo(/*0*/ other: T): kotlin.Int
|
context(kotlin.Comparator<T> /* = java.util.Comparator<T> */) public infix operator fun </*0*/ T> T.compareTo(/*0*/ other: T): kotlin.Int
|
||||||
|
|
||||||
public final data class Pair</*0*/ A, /*1*/ B> {
|
public final data class Pair</*0*/ A, /*1*/ B> {
|
||||||
public constructor Pair</*0*/ A, /*1*/ B>(/*0*/ first: A, /*1*/ second: B)
|
public constructor Pair</*0*/ A, /*1*/ B>(/*0*/ first: A, /*1*/ second: B)
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val kotlin.Int.dp: kotlin.Int
|
context(View) public val kotlin.Int.dp: kotlin.Int
|
||||||
public fun h(): kotlin.Unit
|
public fun h(): kotlin.Unit
|
||||||
public fun View.f(): kotlin.Unit
|
public fun View.f(): kotlin.Unit
|
||||||
public fun kotlin.Int.g(/*0*/ v: View): kotlin.Unit
|
public fun kotlin.Int.g(/*0*/ v: View): kotlin.Unit
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun bar(/*0*/ receiver: Receiver, /*1*/ p: Param): kotlin.Unit
|
context(Context) public fun bar(/*0*/ receiver: Receiver, /*1*/ p: Param): kotlin.Unit
|
||||||
public fun foo(/*0*/ context: Context, /*1*/ receiver: Receiver, /*2*/ p: Param): kotlin.Unit
|
public fun foo(/*0*/ context: Context, /*1*/ receiver: Receiver, /*2*/ p: Param): kotlin.Unit
|
||||||
public fun main(): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun Receiver.baz(/*0*/ p: Param): kotlin.Unit
|
context(Context) public fun Receiver.baz(/*0*/ p: Param): kotlin.Unit
|
||||||
|
|
||||||
public final class Context {
|
public final class Context {
|
||||||
public constructor Context()
|
public constructor Context()
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@ package
|
|||||||
|
|
||||||
public fun </*0*/ T> listOf(/*0*/ vararg items: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
public fun </*0*/ T> listOf(/*0*/ vararg items: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public fun </*0*/ C, /*1*/ T> C.iterator(/*0*/ any: kotlin.Any?): kotlin.collections.Iterator<T>
|
context((IterableClass<C, T> /* = (C) -> kotlin.collections.Iterator<T> */)) public fun </*0*/ C, /*1*/ T> C.iterator(/*0*/ any: kotlin.Any?): kotlin.collections.Iterator<T>
|
||||||
public typealias IterableClass</*0*/ C, /*1*/ T> = (C) -> kotlin.collections.Iterator<T>
|
public typealias IterableClass</*0*/ C, /*1*/ T> = (C) -> kotlin.collections.Iterator<T>
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@ package
|
|||||||
|
|
||||||
public fun json(/*0*/ build: JSONObject.() -> kotlin.Unit): JSONObject
|
public fun json(/*0*/ build: JSONObject.() -> kotlin.Unit): JSONObject
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public infix fun kotlin.String.by(/*0*/ build: JSONObject.() -> kotlin.Unit): kotlin.Unit
|
context(JSONObject) public infix fun kotlin.String.by(/*0*/ build: JSONObject.() -> kotlin.Unit): kotlin.Unit
|
||||||
public infix fun kotlin.String.by(/*0*/ value: kotlin.Any): kotlin.Unit
|
context(JSONObject) public infix fun kotlin.String.by(/*0*/ value: kotlin.Any): kotlin.Unit
|
||||||
|
|
||||||
public final class JSONObject {
|
public final class JSONObject {
|
||||||
public constructor JSONObject()
|
public constructor JSONObject()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun performSomeBusinessOperation(/*0*/ withParams: Params): kotlin.Unit
|
context(LoggingContext) public fun performSomeBusinessOperation(/*0*/ withParams: Params): kotlin.Unit
|
||||||
|
|
||||||
public interface Logger {
|
public interface Logger {
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package
|
|||||||
public fun </*0*/ T> listOf(/*0*/ vararg items: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
public fun </*0*/ T> listOf(/*0*/ vararg items: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public inline fun </*0*/ T, /*1*/ R> kotlin.collections.Iterable<T>.fold(/*0*/ initial: R, /*1*/ operation: (acc: R, T) -> R): R
|
public inline fun </*0*/ T, /*1*/ R> kotlin.collections.Iterable<T>.fold(/*0*/ initial: R, /*1*/ operation: (acc: R, T) -> R): R
|
||||||
public fun </*0*/ T> kotlin.collections.List<T>.sum(): T
|
context(Monoid<T>) public fun </*0*/ T> kotlin.collections.List<T>.sum(): T
|
||||||
|
|
||||||
public object IntMonoid : Monoid<kotlin.Int> {
|
public object IntMonoid : Monoid<kotlin.Int> {
|
||||||
private constructor IntMonoid()
|
private constructor IntMonoid()
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun now(): kotlin.Any?
|
public fun now(): kotlin.Any?
|
||||||
public fun updateUserSession(): kotlin.Unit
|
context(Transaction) public fun updateUserSession(): kotlin.Unit
|
||||||
|
|
||||||
public final class Session {
|
public final class Session {
|
||||||
public constructor Session(/*0*/ lastAccess: kotlin.Any?)
|
public constructor Session(/*0*/ lastAccess: kotlin.Any?)
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun userInfo(/*0*/ name: kotlin.String): Storage<User>.Info?
|
context(Logger, Storage<User>) public fun userInfo(/*0*/ name: kotlin.String): Storage<User>.Info?
|
||||||
|
|
||||||
public final class Logger {
|
public final class Logger {
|
||||||
public constructor Logger()
|
public constructor Logger()
|
||||||
|
|||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun f2(/*0*/ g: context(C) (Param) -> kotlin.Unit): kotlin.Unit
|
context(C) public fun f2(/*0*/ g: context(C) (Param) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun f4(/*0*/ g: context(C) () -> kotlin.Unit): kotlin.Unit
|
context(C) public fun f4(/*0*/ g: context(C) () -> kotlin.Unit): kotlin.Unit
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public fun R.f1(/*0*/ g: context(C) R.(Param) -> kotlin.Unit): kotlin.Unit
|
context(C) public fun R.f1(/*0*/ g: context(C) R.(Param) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun R.f3(/*0*/ g: context(C) R.() -> kotlin.Unit): kotlin.Unit
|
context(C) public fun R.f3(/*0*/ g: context(C) R.() -> kotlin.Unit): kotlin.Unit
|
||||||
|
|
||||||
public final class C {
|
public final class C {
|
||||||
public constructor C()
|
public constructor C()
|
||||||
|
|||||||
+2
-2
@@ -3,14 +3,14 @@ package
|
|||||||
public fun kotlin.collections.Collection<kotlin.Int>.bar(): kotlin.Unit
|
public fun kotlin.collections.Collection<kotlin.Int>.bar(): kotlin.Unit
|
||||||
public fun kotlin.Int.foo(): kotlin.Unit
|
public fun kotlin.Int.foo(): kotlin.Unit
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
context(T) public final class A</*0*/ T> {
|
||||||
public constructor A</*0*/ T>()
|
public constructor A</*0*/ T>()
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class B</*0*/ P> {
|
context(kotlin.collections.Collection<P>) public final class B</*0*/ P> {
|
||||||
public constructor B</*0*/ P>()
|
public constructor B</*0*/ P>()
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun B.bar(): kotlin.Unit
|
context(A) public fun B.bar(): kotlin.Unit
|
||||||
public fun B.foo(): kotlin.Unit
|
public fun B.foo(): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val p: kotlin.String
|
context(kotlin.String) public val p: kotlin.String
|
||||||
public fun kotlin.Int.f(): kotlin.Unit
|
context(kotlin.String) public fun kotlin.Int.f(): kotlin.Unit
|
||||||
public fun kotlin.collections.List<kotlin.Int>.f(): kotlin.Unit
|
public fun kotlin.collections.List<kotlin.Int>.f(): kotlin.Unit
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun </*0*/ T> f(/*0*/ lazy1: Lazy<kotlin.Int>, /*1*/ lazy2: Lazy<kotlin.CharSequence>, /*2*/ lazyT: Lazy<T>, /*3*/ lazyLazyT: Lazy<Lazy<T>>): kotlin.Unit
|
public fun </*0*/ T> f(/*0*/ lazy1: Lazy<kotlin.Int>, /*1*/ lazy2: Lazy<kotlin.CharSequence>, /*2*/ lazyT: Lazy<T>, /*3*/ lazyLazyT: Lazy<Lazy<T>>): kotlin.Unit
|
||||||
public fun test1(): kotlin.Unit
|
context(Lazy<kotlin.Int>, Lazy<kotlin.CharSequence>) public fun test1(): kotlin.Unit
|
||||||
public fun </*0*/ T> Lazy<kotlin.Int>.test2(): kotlin.Unit
|
context(Lazy<T>) public fun </*0*/ T> Lazy<kotlin.Int>.test2(): kotlin.Unit
|
||||||
public fun </*0*/ T> Lazy<kotlin.Int>.test3(): kotlin.Unit
|
context(Lazy<Lazy<T>>) public fun </*0*/ T> Lazy<kotlin.Int>.test3(): kotlin.Unit
|
||||||
|
|
||||||
public interface Lazy</*0*/ T> {
|
public interface Lazy</*0*/ T> {
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C): kotlin.Unit
|
public fun main(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C): kotlin.Unit
|
||||||
public fun C.f(): kotlin.Unit
|
context(A, B) public fun C.f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val a: kotlin.Int = 1
|
context(A) public val a: kotlin.Int = 1
|
||||||
public var b: kotlin.Int
|
context(B, A) public var b: kotlin.Int
|
||||||
public val c: kotlin.Int
|
context(B, A) public val c: kotlin.Int
|
||||||
|
|
||||||
public interface A {
|
public interface A {
|
||||||
public abstract fun a(): kotlin.Int
|
public abstract fun a(): kotlin.Int
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ public final class A {
|
|||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
public final inline class B {
|
context(A) public final inline class B {
|
||||||
public constructor B(/*0*/ x: kotlin.Int)
|
public constructor B(/*0*/ x: kotlin.Int)
|
||||||
public final val x: kotlin.Int
|
public final val x: kotlin.Int
|
||||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun B.f(): kotlin.Unit
|
context(A) public fun B.f(): kotlin.Unit
|
||||||
public fun B.g(): kotlin.Unit
|
context(A) public fun B.g(): kotlin.Unit
|
||||||
public fun C.h(): kotlin.Unit
|
context(A) public fun C.h(): kotlin.Unit
|
||||||
public fun A.q(/*0*/ b: B): kotlin.Unit
|
public fun A.q(/*0*/ b: B): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public fun f(/*0*/ outer: Outer): kotlin.Unit
|
public fun f(/*0*/ outer: Outer): kotlin.Unit
|
||||||
|
|
||||||
public final class Inner {
|
context(Outer) public final class Inner {
|
||||||
public constructor Inner(/*0*/ arg: kotlin.Any)
|
public constructor Inner(/*0*/ arg: kotlin.Any)
|
||||||
public final fun bar(): kotlin.Int
|
public final fun bar(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
|
context(Context) public fun f(): kotlin.String
|
||||||
public fun f(): kotlin.Any
|
public fun f(): kotlin.Any
|
||||||
public fun f(): kotlin.String
|
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
|
|
||||||
public final class Context {
|
public final class Context {
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun foo(): kotlin.Int
|
context(kotlin.Int) public fun foo(): kotlin.Int
|
||||||
public fun foo(): kotlin.Int
|
context(kotlin.Int, kotlin.String) public fun foo(): kotlin.Int
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun Matrix.plus(/*0*/ other: Matrix): Matrix
|
context(NumberOperations) public fun Matrix.plus(/*0*/ other: Matrix): Matrix
|
||||||
public fun NumberOperations.plusMatrix(/*0*/ m1: Matrix, /*1*/ m2: Matrix): kotlin.Unit
|
public fun NumberOperations.plusMatrix(/*0*/ m1: Matrix, /*1*/ m2: Matrix): kotlin.Unit
|
||||||
|
|
||||||
public final class Matrix {
|
public final class Matrix {
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ public final class B : A {
|
|||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
public final inner class C {
|
context(Context) public final inner class C {
|
||||||
public constructor C()
|
public constructor C()
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public final fun g(): kotlin.Unit
|
public final fun g(): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun foo(): kotlin.Unit
|
context([ERROR : No type element]) public fun foo(): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun f(): kotlin.Unit
|
context(A) public fun f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
public constructor A(/*0*/ a: kotlin.String?)
|
public constructor A(/*0*/ a: kotlin.String?)
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val C.p: kotlin.Int
|
context(B, A<kotlin.String>, A<kotlin.Int>) public val C.p: kotlin.Int
|
||||||
public fun f(): kotlin.Unit
|
context(A<kotlin.Int>, A<kotlin.String>, B) public fun f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
public final class A</*0*/ T> {
|
||||||
public constructor A</*0*/ T>(/*0*/ a: T)
|
public constructor A</*0*/ T>(/*0*/ a: T)
|
||||||
|
|||||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ public final class A {
|
|||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class B {
|
context(A) public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
public final val prop: [ERROR : Type for x + this@A.x]
|
public final val prop: [ERROR : Type for x + this@A.x]
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
Vendored
+4
-5
@@ -1,9 +1,9 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun f(): kotlin.Unit
|
context(A<kotlin.Int>, A<kotlin.String>, B) public fun f(): kotlin.Unit
|
||||||
public fun f(): kotlin.Unit
|
context(A<kotlin.String>, B) public fun f(): kotlin.Unit
|
||||||
public fun A<kotlin.Int>.f(): kotlin.Unit
|
context(A<kotlin.String>) public fun A<kotlin.Int>.f(): kotlin.Unit
|
||||||
public fun C.f(): kotlin.Unit
|
context(A<kotlin.Int>, A<kotlin.String>, B) public fun C.f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
public final class A</*0*/ T> {
|
||||||
public constructor A</*0*/ T>(/*0*/ a: T)
|
public constructor A</*0*/ T>(/*0*/ a: T)
|
||||||
@@ -28,4 +28,3 @@ public final class C {
|
|||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsProperties.txt
Vendored
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public var p: kotlin.Int
|
context(B, A<kotlin.String>) public var p: kotlin.Int
|
||||||
public var p: kotlin.Int
|
context(B, A<kotlin.String>, A<kotlin.Int>) public var p: kotlin.Int
|
||||||
public val C.p: kotlin.Int
|
context(B, A<kotlin.String>, A<kotlin.Int>) public val C.p: kotlin.Int
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
public final class A</*0*/ T> {
|
||||||
public constructor A</*0*/ T>(/*0*/ a: T)
|
public constructor A</*0*/ T>(/*0*/ a: T)
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun test(): kotlin.Unit
|
public fun test(): kotlin.Unit
|
||||||
public fun </*0*/ T> useContext(/*0*/ block: (T) -> kotlin.Unit): kotlin.Unit
|
context(T) public fun </*0*/ T> useContext(/*0*/ block: (T) -> kotlin.Unit): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun </*0*/ T> T.f(/*0*/ t: B<T>): kotlin.Unit
|
context(T) public fun </*0*/ T> T.f(/*0*/ t: B<T>): kotlin.Unit
|
||||||
public fun kotlin.Int.main(/*0*/ a: A, /*1*/ b: B<kotlin.String>): kotlin.Unit
|
public fun kotlin.Int.main(/*0*/ a: A, /*1*/ b: B<kotlin.String>): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public fun </*0*/ T> listOf(/*0*/ vararg e: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
public fun </*0*/ T> listOf(/*0*/ vararg e: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
||||||
public fun main(): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T> A<T>.f(): kotlin.Unit
|
context(kotlin.collections.List<T>) public fun </*0*/ T> A<T>.f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
public final class A</*0*/ T> {
|
||||||
public constructor A</*0*/ T>()
|
public constructor A</*0*/ T>()
|
||||||
|
|||||||
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun f(/*0*/ g: context(kotlin.Any) () -> kotlin.Unit, /*1*/ value: kotlin.Any): context(A) () -> kotlin.Unit
|
context(kotlin.Any) public fun f(/*0*/ g: context(kotlin.Any) () -> kotlin.Unit, /*1*/ value: kotlin.Any): context(A) () -> kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
context(kotlin.String, kotlin.Int) public final class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
public final val p: kotlin.Any
|
context(kotlin.Any) public final val p: kotlin.Any
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public final fun m(): kotlin.Unit
|
context(kotlin.String, kotlin.Int) public final fun m(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun B.f(): kotlin.Unit
|
context(A) public fun B.f(): kotlin.Unit
|
||||||
|
|
||||||
public open class A {
|
public open class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun B.f(): kotlin.Unit
|
context(A) public fun B.f(): kotlin.Unit
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
|
|||||||
@@ -676,6 +676,7 @@ internal class DescriptorRendererImpl(
|
|||||||
if (!startFromName) {
|
if (!startFromName) {
|
||||||
if (!startFromDeclarationKeyword) {
|
if (!startFromDeclarationKeyword) {
|
||||||
builder.renderAnnotations(function)
|
builder.renderAnnotations(function)
|
||||||
|
renderContextReceivers(function.contextReceiverParameters, builder)
|
||||||
renderVisibility(function.visibility, builder)
|
renderVisibility(function.visibility, builder)
|
||||||
renderModalityForCallable(function, builder)
|
renderModalityForCallable(function, builder)
|
||||||
|
|
||||||
@@ -732,17 +733,39 @@ internal class DescriptorRendererImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun KotlinType.renderForReceiver(): String {
|
||||||
|
var result = renderType(this)
|
||||||
|
if (shouldRenderAsPrettyFunctionType(this) && !TypeUtils.isNullableType(this)) {
|
||||||
|
result = "($result)"
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun renderContextReceivers(contextReceivers: List<ReceiverParameterDescriptor>, builder: StringBuilder) {
|
||||||
|
if (contextReceivers.isNotEmpty()) {
|
||||||
|
builder.append("context(")
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for ((i, contextReceiver) in contextReceivers.withIndex()) {
|
||||||
|
builder.renderAnnotations(contextReceiver, AnnotationUseSiteTarget.RECEIVER)
|
||||||
|
val typeString = contextReceiver.type.renderForReceiver()
|
||||||
|
builder.append(typeString)
|
||||||
|
if (i == contextReceivers.lastIndex) {
|
||||||
|
builder.append(") ")
|
||||||
|
} else {
|
||||||
|
builder.append(", ")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun renderReceiver(callableDescriptor: CallableDescriptor, builder: StringBuilder) {
|
private fun renderReceiver(callableDescriptor: CallableDescriptor, builder: StringBuilder) {
|
||||||
val receiver = callableDescriptor.extensionReceiverParameter
|
val receiver = callableDescriptor.extensionReceiverParameter
|
||||||
if (receiver != null) {
|
if (receiver != null) {
|
||||||
builder.renderAnnotations(receiver, AnnotationUseSiteTarget.RECEIVER)
|
builder.renderAnnotations(receiver, AnnotationUseSiteTarget.RECEIVER)
|
||||||
|
|
||||||
val type = receiver.type
|
val typeString = receiver.type.renderForReceiver()
|
||||||
var result = renderType(type)
|
builder.append(typeString).append(".")
|
||||||
if (shouldRenderAsPrettyFunctionType(type) && !TypeUtils.isNullableType(type)) {
|
|
||||||
result = "($result)"
|
|
||||||
}
|
|
||||||
builder.append(result).append(".")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -904,6 +927,7 @@ internal class DescriptorRendererImpl(
|
|||||||
if (!startFromName) {
|
if (!startFromName) {
|
||||||
if (!startFromDeclarationKeyword) {
|
if (!startFromDeclarationKeyword) {
|
||||||
renderPropertyAnnotations(property, builder)
|
renderPropertyAnnotations(property, builder)
|
||||||
|
renderContextReceivers(property.contextReceiverParameters, builder)
|
||||||
renderVisibility(property.visibility, builder)
|
renderVisibility(property.visibility, builder)
|
||||||
renderModifier(builder, DescriptorRendererModifier.CONST in modifiers && property.isConst, "const")
|
renderModifier(builder, DescriptorRendererModifier.CONST in modifiers && property.isConst, "const")
|
||||||
renderMemberModifiers(property, builder)
|
renderMemberModifiers(property, builder)
|
||||||
@@ -988,6 +1012,7 @@ internal class DescriptorRendererImpl(
|
|||||||
|
|
||||||
if (!startFromName) {
|
if (!startFromName) {
|
||||||
builder.renderAnnotations(klass)
|
builder.renderAnnotations(klass)
|
||||||
|
renderContextReceivers(klass.contextReceivers, builder)
|
||||||
if (!isEnumEntry) {
|
if (!isEnumEntry) {
|
||||||
renderVisibility(klass.visibility, builder)
|
renderVisibility(klass.visibility, builder)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user