FIR: Add context receivers from the containing class to constructors

This commit is contained in:
Denis.Zharkov
2022-03-09 15:37:53 +03:00
committed by teamcity
parent b2d5bf3eae
commit 202413c2f4
6 changed files with 8 additions and 33 deletions
@@ -1,15 +0,0 @@
// !LANGUAGE: +ContextReceivers
context(T) class A<T>
context(Collection<P>) class B<P>
fun Int.foo() {
A<Int>()
A<String>()
}
fun Collection<Int>.bar() {
B<Int>()
B<String>()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
context(T) class A<T>
@@ -1,18 +0,0 @@
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Outer {
val x: Int = 1
}
context(Outer)
class Inner(arg: Any) {
fun bar() = x
}
fun f(outer: Outer) {
Inner(1)
with(outer) {
Inner(3)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -UNUSED_PARAMETER