FIR: Add context receivers from the containing class to constructors
This commit is contained in:
-15
@@ -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
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
|
||||
context(T) class A<T>
|
||||
|
||||
-18
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user