Files
kotlin-fork/analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/contextReceiver.descriptors.rendered
T
Marco Pennekamp 2cd16f055a [AA] KT-55098 Render context receivers in declarations & function types
- `context(...)` is a modifier that must precede annotations and other
  modifiers, so for declarations it is rendered in
  `renderAnnotationsAndModifiers`.
- Ignore `@ContextFunctionTypeParams` in the annotation list of FE10
  types, as the annotation is an implementation detail of context
  receivers in K1 and shouldn't be rendered.

^KT-55098 fixed
2022-12-06 17:43:30 +00:00

38 lines
531 B
Plaintext
Vendored

interface Context1
interface Context2<A> {
fun getContextElement(): A
}
class Context2Impl<A>(value: A) : Context2<A> {
override fun getContextElement(): A
val value: A
}
context(Int, String)
class A {
constructor(int: Int)
}
context(Context1, c2@Context2<String>)
class B {
override fun toString(): String
}
context(Context2<A>)
class C<A> {
val a: A
get()
}
context(Context1)
@Deprecated(message = "Use `B` instead.")
class D
context(b@B, `fun`@A)
fun foo()
context(Context2<C<String>>)
fun bar(): ERROR