[FIR] Unify some special names to make code more uniform
This commit is contained in:
@@ -61,6 +61,24 @@ object SpecialNames {
|
||||
@JvmField
|
||||
val IMPLICIT_SET_PARAMETER = Name.special("<set-?>")
|
||||
|
||||
@JvmField
|
||||
val ARRAY = Name.special("<array>")
|
||||
|
||||
@JvmField
|
||||
val RECEIVER = Name.special("<receiver>")
|
||||
|
||||
/**
|
||||
* Special name to store expressions used as indexes in subscription operators (`get` and `set`).
|
||||
*
|
||||
* For example, `bar1()` and `bar2()` are indexes in `foo[bar1(), bar2()]` call.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun subscribeOperatorIndex(idx: Int): Name {
|
||||
require(idx >= 0) { "Index should be non-negative, but was $idx" }
|
||||
|
||||
return Name.special("<index_$idx>")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun safeIdentifier(name: Name?): Name {
|
||||
return if (name != null && !name.isSpecial) name else SAFE_IDENTIFIER_FOR_NO_NAME
|
||||
|
||||
Reference in New Issue
Block a user