FIR IDE: introduce builtin types container

This commit is contained in:
Ilya Kirillov
2020-12-13 12:18:05 +01:00
parent 835577383b
commit c2d83353e8
3 changed files with 74 additions and 0 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.idea.frontend.api.components
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.idea.frontend.api.ValidityTokenOwner
import org.jetbrains.kotlin.idea.frontend.api.types.KtType
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtExpression
@@ -21,4 +22,28 @@ abstract class KtTypeProvider : KtAnalysisSessionComponent() {
abstract fun isBuiltinFunctionalType(type: KtType): Boolean
abstract fun getExpectedType(expression: PsiElement): KtType?
abstract val builtinTypes: KtBuiltinTypes
}
@Suppress("PropertyName")
abstract class KtBuiltinTypes : ValidityTokenOwner {
abstract val INT: KtType
abstract val LONG: KtType
abstract val SHORT: KtType
abstract val BYTE: KtType
abstract val FLOAT: KtType
abstract val DOUBLE: KtType
abstract val BOOLEAN: KtType
abstract val CHAR: KtType
abstract val STRING: KtType
abstract val UNIT: KtType
abstract val NOTHING: KtType
abstract val ANY: KtType
abstract val NULLABLE_ANY: KtType
abstract val NULLABLE_NOTHING: KtType
}