title: Ð ÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ ÑÐ²Ð½Ð¾ ÑÐ¸Ð¿Ð¸Ð·Ð¸ÑÐ¾Ð²Ð°Ð½Ð½ÑÑ Ð¿Ð¾Ð»ÐµÐ¹ Ð² ÐºÐ¾Ð¼Ð¿Ð¸Ð»ÑÑÐ¾ÑÐµ ÑÐ·ÑÐºÐ° Kotlin
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð±Ð°ÐºÐ°Ð»Ð°Ð²ÑÐ°
titleType: Subtitle
title: Implementing explicit backing fields for the Kotlin compiler
Creators: name: ÐÑÐ½ÑÐº, ÐÐ¸ÐºÐ¾Ð»Ð°Ð¹
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2022
Subjects: ÑÐ·ÑÐº Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Kotlin
ÑÐµÐ½ÐµÐ²ÑÐµ ÑÐ²Ð¾Ð¹ÑÑÐ²Ð°
ÐºÐ¾Ð¼Ð¿Ð¸Ð»ÑÑÐ¾ÑÑ
Kotlin programming language
backing properties
compilers
language feature

description: Ð¢ÐµÐ¼Ð° Ð²ÑÐ¿ÑÑÐºÐ½Ð¾Ð¹ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÑ: Â«Ð ÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ ÑÐ²Ð½Ð¾ ÑÐ¸Ð¿Ð¸Ð·Ð¸ÑÐ¾Ð²Ð°Ð½Ð½ÑÑ Ð¿Ð¾Ð»ÐµÐ¹ Ð² ÐºÐ¾Ð¼Ð¿Ð¸Ð»ÑÑÐ¾ÑÐµ ÑÐ·ÑÐºÐ° KotlinÂ».Ð Ð½Ð°ÑÑÐ¾ÑÑÐµÐ¹ ÑÐ°Ð±Ð¾ÑÐµ ÑÐ°ÑÑÐ¼Ð¾ÑÑÐµÐ½Ñ Ð¿ÑÐ¾Ð±Ð»ÐµÐ¼Ñ, ÑÐ²ÑÐ·Ð°Ð½Ð½ÑÐµ Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ ÑÐ°Ð±Ð»Ð¾Ð½Ð° Â«ÑÐµÐ½ÐµÐ²ÑÑ ÑÐ²Ð¾Ð¹ÑÑÐ²Â» (Ð°Ð½Ð³Ð». backing properties) Ð¿ÑÐ¸ Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð¸Ð¸ Ð¸ÑÑÐ¾Ð´Ð½Ð¾Ð³Ð¾ ÐºÐ¾Ð´Ð° Ð½Ð° ÑÐ·ÑÐºÐµ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Kotlin. ÐÐ°Ð½Ð½ÑÐµ Ð¿ÑÐ¾Ð±Ð»ÐµÐ¼Ñ ÑÐ²Ð»ÑÑÑÑÑ ÑÐ¿ÐµÑÐ¸ÑÐ¸ÑÐ½ÑÐ¼Ð¸ Ð´Ð»Ñ Kotlin, Ð° Ð¿Ð¾ÑÐ¾Ð¼Ñ Ð³Ð¾ÑÐ¾Ð²ÑÑ ÑÐµÑÐµÐ½Ð¸Ð¹ Ð½Ðµ Ð¸Ð¼ÐµÑÑ. ÐÑÐ» Ð¿ÑÐ¾Ð²ÐµÐ´ÐµÐ½ Ð°Ð½Ð°Ð»Ð¸Ð· ÑÐ°Ð·Ð½ÑÑ Ð²Ð°ÑÐ¸Ð°Ð½ÑÐ¾Ð² Ð¸Ñ ÑÐµÑÐµÐ½Ð¸Ñ Ð¸ Ð²ÑÐ±ÑÐ°Ð½Ñ ÑÐ°Ð¼ÑÐµ Ð¾Ð¿ÑÐ¸Ð¼Ð°Ð»ÑÐ½ÑÐµ Ð¸Ð· Ð½Ð¸Ñ. ÐÐ»Ñ Ð²ÑÐ±ÑÐ°Ð½Ð½ÑÑ Ð²Ð°ÑÐ¸Ð°Ð½ÑÐ¾Ð² Ð±ÑÐ»Ð¸ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐ°Ð½Ñ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð½ÑÐµ Ð¿ÑÐ¾ÑÐ¾ÑÐ¸Ð¿Ñ, Ð¿ÑÐµÐ´ÑÑÐ°Ð²Ð»ÑÑÑÐ¸Ðµ ÑÐ¾Ð±Ð¾Ð¹ Ð¼Ð¾Ð´Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¸ ÐºÐ¾Ð¼Ð¿Ð¸Ð»ÑÑÐ¾ÑÐ° ÑÐ·ÑÐºÐ° Kotlin, Ð¸ Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÑÑÐ¸Ðµ Ð¾ÑÐºÐ°Ð·Ð°ÑÑÑÑ Ð¾Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ ÑÐ°Ð±Ð»Ð¾Ð½Ð° Â«ÑÐµÐ½ÐµÐ²ÑÑ ÑÐ²Ð¾Ð¹ÑÑÐ²Â» Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ ÑÐ¿ÐµÑÐ¸Ð°Ð»ÑÐ½Ð¾Ð³Ð¾ ÑÐ¸Ð½ÑÐ°ÐºÑÐ¸ÑÐ°.Ð ÑÐ°Ð¼ÐºÐ°Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÑ Ð¿ÑÐµÐ´Ð»Ð°Ð³Ð°ÐµÑÑÑ ÑÐ°ÑÑÐ¸ÑÐ¸ÑÑ ÑÐ¸Ð½ÑÐ°ÐºÑÐ¸Ñ ÑÐ²Ð¾Ð¹ÑÑÐ² Ð² ÑÐ·ÑÐºÐµ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Kotlin, Ð¿Ð¾Ð·Ð²Ð¾Ð»Ð¸Ð² ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÑÐ¸ÐºÑ Ð¾Ð¿ÑÐµÐ´ÐµÐ»Ð¸ÑÑ ÑÑÐ°Ð½Ð¸Ð¼ÑÐ¹ Ð²Ð½ÑÑÑÐ¸ Ð¿Ð¾Ð»Ñ Ð¾Ð±ÑÐµÐºÑ Ð¸ ÐµÐ³Ð¾ ÑÐ¸Ð¿ ÑÐ²Ð½ÑÐ¼ Ð¾Ð±ÑÐ°Ð·Ð¾Ð¼, Ð° ÑÐ°ÐºÐ¶Ðµ Ð¿Ð¾Ð·Ð²Ð¾Ð»Ð¸ÑÑ Ð¿Ð¾Ð»ÑÑÐ°ÑÑ Ð´Ð¾ÑÑÑÐ¿ Ðº ÑÑÐ¾Ð¼Ñ Ð¿Ð¾Ð»Ñ Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ ÑÐ¿ÐµÑÐ¸Ð°Ð»ÑÐ½Ð¾Ð³Ð¾ Ð¼ÐµÑÐ°Ð½Ð¸Ð·Ð¼Ð° ÑÑÐ¶ÐµÐ½Ð¸Ñ ÑÐ¸Ð¿Ð° Ð² Ð¼ÐµÑÑÐµ Ð²ÑÐ·Ð¾Ð²Ð° Ð¿ÑÐ¸ ÑÐ¾Ð±Ð»ÑÐ´ÐµÐ½Ð¸Ð¸ Ð¾Ð¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ð½ÑÑ ÑÑÐ»Ð¾Ð²Ð¸Ð¹. ÐÐ»Ñ Ð¾ÑÑÐ°Ð»ÑÐ½ÑÑ ÑÐ¸ÑÑÐ°ÑÐ¸Ð¹ Ð¿ÑÐµÐ´Ð»Ð°Ð³Ð°ÐµÑÑÑ ÑÐ¿Ð¾ÑÐ¾Ð± Ð¿Ð¾Ð»ÑÑÐ¸ÑÑ Ð´Ð¾ÑÑÑÐ¿ Ðº Ð¿Ð¾Ð»Ñ ÑÐ²Ð¾Ð¹ÑÑÐ²Ð° Ð½Ð°Ð¿ÑÑÐ¼ÑÑ, Ð° ÑÐ°ÐºÐ¶Ðµ ÑÐ¿Ð¾ÑÐ¾Ð± Ð¿Ð¾Ð»ÑÑÐ¸ÑÑ Ð´Ð¾ÑÑÑÐ¿ Ðº ÑÐ»ÐµÐ½Ð°Ð¼ ÐºÐ»Ð°ÑÑÐ°-Ð´ÐµÐ»ÐµÐ³Ð°ÑÐ° Ð´Ð»Ñ Ð´ÐµÐ»ÐµÐ³Ð¸ÑÐ¾Ð²Ð°Ð½Ð½ÑÑ ÑÐ²Ð¾Ð¹ÑÑÐ².
description: The subject of the graduate qualification work is Â«Implementing explicit backing fields for the Kotlin compilerÂ».The current work was aimed to review the problems introduced by the backing properties programming pattern, which can be frequently found in Kotlin source code. These problems are Kotlin-specific, and therefore ready-made solutions are unavailable. A number of different approaches to solve them has been reviewed, and the most appropriate solutions have been chosen. For the ones chosen the corresponding prototypes have been developed in forms of the modified Kotlin compiler versions allowing to abandon the backing properties pattern with the help of special syntax.This work suggests extending the Kotlin programming language with the ability to declare the object stored in a property field and its type explicitly, along with a mechanism of use-site type narrowing, available if certain conditions are satisfied. To cover other cases a way of accessing property fields and delegate members directly is suggested.