[FE] Prohibit property initializers with context receivers

This commit is contained in:
Anastasiya Shadrina
2020-12-07 22:10:44 +07:00
committed by TeamCityServer
parent daa54734e5
commit d704862582
8 changed files with 64 additions and 0 deletions
@@ -0,0 +1,15 @@
interface A {
fun a(): Int
}
interface B {
fun b(): Int
}
context(A)
val a = 1
context(A, B)
var b = 2
context(A, B)
val c get() = <!UNRESOLVED_REFERENCE!>a<!>() + <!UNRESOLVED_REFERENCE!>b<!>()
@@ -0,0 +1,15 @@
interface A {
fun a(): Int
}
interface B {
fun b(): Int
}
context(A)
val a = <!CONTEXT_RECEIVERS_WITH_BACKING_FIELD!>1<!>
context(A, B)
var b = <!CONTEXT_RECEIVERS_WITH_BACKING_FIELD!>2<!>
context(A, B)
val c get() = a() + b()
@@ -0,0 +1,19 @@
package
public val a: kotlin.Int = 1
public var b: kotlin.Int
public val c: kotlin.Int
public interface A {
public abstract fun a(): kotlin.Int
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 toString(): kotlin.String
}
public interface B {
public abstract fun b(): kotlin.Int
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 toString(): kotlin.String
}