[FE] Inline classes cannot have context receivers

This commit is contained in:
Anastasiya Shadrina
2021-03-16 19:21:05 +07:00
committed by TeamCityServer
parent d704862582
commit 1a0aab4a44
9 changed files with 64 additions and 0 deletions
@@ -188,6 +188,22 @@ abstract class KtClassOrObject :
return parts.joinToString(separator = ".")
}
fun getContextReceiverList(): KtContextReceiverList? {
val stub = stub
if (stub != null) {
return getStubOrPsiChild(KtStubElementTypes.CONTEXT_RECEIVER_LIST)
}
var node = node.firstChildNode
while (node != null) {
val tt = node.elementType
if (tt === KtNodeTypes.CONTEXT_RECEIVER_LIST) {
return node.psi as KtContextReceiverList
}
node = node.treeNext
}
return null
}
override fun getContextReceivers(): List<KtContextReceiver> {
val stub = stub
if (stub != null) {