FIR: fix position and reporting of PRIVATE_SETTER_*

Previously `FirPropertyAccessor.source` references the `KtProperty` if
the user code contains a setter or getter that doesn't contain a body.
For example, with the following

```
val i: Int = 1
  private set
```

The `FirPropertyAccessor` would reference the `KtProperty` as the
source.

This change makes `FirPropertyAccessor` reference `KtPropertyAccessor`
as the source if possible, regardless of whether the body is present or
not.
This commit is contained in:
Tianyu Geng
2021-02-18 16:28:27 -08:00
committed by Mikhail Glukhikh
parent bdeecfc188
commit 5bdea9652b
14 changed files with 56 additions and 55 deletions
@@ -11,8 +11,8 @@ enum class MyEnum() {
var b: Int private set
var b1: Int = 0; private set
abstract var b2: Int private set
abstract var b3: Int = <!ABSTRACT_PROPERTY_WITH_INITIALIZER!>0<!>; private set
abstract var b2: Int <!PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY!>private<!> set
abstract var b3: Int = <!ABSTRACT_PROPERTY_WITH_INITIALIZER!>0<!>; <!PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY!>private<!> set
var c: Int set(v: Int) { field = v }
var c1: Int = 0; set(v: Int) { field = v }
@@ -44,4 +44,4 @@ enum class MyEnum() {
var l1: Int = 0; abstract get abstract set
var n: Int abstract get abstract set(v: Int) {}
}
}