[FIR2IR] Cache Java field-based properties more correctly #KT-42805 Fixed

Before this commit, we cached such IR properties by FIR property
which was created by Java field each time when we referenced it.
This led to signature clashes. Now we cache such IR properties
directly by associated FIR field.
This commit is contained in:
Mikhail Glukhikh
2020-10-19 18:21:24 +03:00
parent 3576cbf0d8
commit 23e7468e57
5 changed files with 42 additions and 21 deletions
@@ -0,0 +1,9 @@
FILE fqName:<root> fileName:/SameJavaFieldReferences.kt
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:ref1 type:kotlin.reflect.KProperty0<kotlin.String?> [val]
PROPERTY_REFERENCE 'public final someJavaField: kotlin.String? [val]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:someJavaField type:kotlin.String? visibility:public [final,static]' getter=null setter=null type=kotlin.reflect.KProperty0<kotlin.String?> origin=null
<1>: <none>
VAR name:ref2 type:kotlin.reflect.KProperty0<kotlin.String?> [val]
PROPERTY_REFERENCE 'public final someJavaField: kotlin.String? [val]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:someJavaField type:kotlin.String? visibility:public [final,static]' getter=null setter=null type=kotlin.reflect.KProperty0<kotlin.String?> origin=null
<1>: <none>