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
@@ -1,14 +1,14 @@
abstract class My {
abstract var x: Int
public get
private set
<!PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY!>private<!> set
abstract val y: Int
protected get
abstract protected var z: Int
internal get
private set
<!PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY!>private<!> set
abstract internal val w: Int
protected get
@@ -17,5 +17,5 @@ abstract class My {
protected set
open var t: Int = 0
private set
}
<!PRIVATE_SETTER_FOR_OPEN_PROPERTY!>private<!> set
}