[Analysis API] add info about context receivers to the Analysis API

This commit is contained in:
Ilya Kirillov
2022-06-30 17:52:10 +02:00
parent 2f822ab4d9
commit 8f89f1b368
40 changed files with 481 additions and 16 deletions
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.impl.base
import org.jetbrains.kotlin.analysis.api.KtAnalysisApiInternals
import org.jetbrains.kotlin.analysis.api.base.KtContextReceiver
import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.name.Name
@KtAnalysisApiInternals
class KtContextReceiverImpl(
private val _type: KtType,
private val _label: Name?,
override val token: KtLifetimeToken
) : KtContextReceiver() {
override val label: Name? get() = withValidityAssertion { _label }
override val type: KtType get() = withValidityAssertion { _type }
}