https://kotlinlang.org logo
#compiler
Title
# compiler
i

Icyrockton

09/19/2023, 9:26 AM
What is the main purpose of
FirSignatureEnhancement
, is it to enhance the type of the
JavaField
, `JavaMethod`etc. based on the type in the overridden?
d

dmitriy.novozhilov

09/19/2023, 9:34 AM
FirSignatureEnhancement
converts declarations from java model into how it should look from the Kotlin side, including • simple transformation of types • mapping builtin types (
java.lang.String
->
kotlin.String
) • mapping collection types • provide correct nullability (flexible types or regular types in presence of nullability annotations) It also paired with
FirJavaClassUseSiteMemberScope
and
JvmMappedScope
, which also perform some other things, like • creating properties based on java getters, if this getter overrides some kotlin property • renames and transforms some java methods (e.g. in collections) to fir kotlin hierarchies (
Map<K, R>.containsKey(Object key) -> Map<K, R>.containsKey(key: K)
• transforms some functions to properties (
List.size() -> List.size
)
thank you color 1