FIR: use SyntheticPropertySymbol & synthetic scope instead of FirAccessorSymbol

Before this commit, we used FirAccessorSymbol to emulate synthetic properties.
These symbols were generated in Java use-site scope.
Now, we use synthetic scope instead which is above MemberScopeTowerLevel.
This is more performance-friendly and does not require override matching.
However, accessor symbols should be used in situation when Java accessor
overrides Kotlin property which is broken in this commit
(that's why MapEntry test is corrupted here).
Also, we should not create synthetics for pure Kotlin accessors
(that's why javaAccessorConversion test is corrupted here).
This commit is contained in:
Mikhail Glukhikh
2019-11-29 15:56:23 +03:00
parent ae62ccb76d
commit d15dae6ac6
13 changed files with 76 additions and 84 deletions
@@ -5,4 +5,9 @@
package org.jetbrains.kotlin.fir.symbols
interface SyntheticSymbol
interface SyntheticSymbol
interface AccessorSymbol : SyntheticSymbol {
val callableId: CallableId // it's an id of related property (synthetic or not)
val accessorId: CallableId // it's an id of accessor function
}
@@ -6,8 +6,8 @@
package org.jetbrains.kotlin.fir.symbols.impl
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.symbols.AccessorSymbol
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.SyntheticSymbol
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
@@ -35,8 +35,8 @@ class FirConstructorSymbol(
class FirAccessorSymbol(
callableId: CallableId,
val accessorId: CallableId
) : FirFunctionSymbol<FirSimpleFunction>(callableId), SyntheticSymbol
override val accessorId: CallableId
) : FirFunctionSymbol<FirSimpleFunction>(callableId), AccessorSymbol
// ------------------------ unnamed ------------------------