[Analysis API FIR] preserve type annotations on asPsiType conversion

^KT-66603 Fixed
This commit is contained in:
Dmitrii Gridin
2024-03-14 18:31:58 +01:00
committed by Space Team
parent 3c8a95e623
commit 96575a0bdb
18 changed files with 136 additions and 48 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2024 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.
*/
@@ -65,6 +65,23 @@ internal class KtFe10PsiTypeProvider(
)
}
override fun asPsiType(
type: KtType,
useSitePosition: PsiElement,
allowErrorTypes: Boolean,
mode: KtTypeMappingMode,
isAnnotationMethod: Boolean,
suppressWildcards: Boolean?,
preserveAnnotations: Boolean
): PsiType? = asPsiTypeElement(
type = type,
useSitePosition = useSitePosition,
mode = mode,
isAnnotationMethod = isAnnotationMethod,
suppressWildcards = suppressWildcards,
allowErrorTypes = allowErrorTypes,
)?.type
private fun KtTypeMappingMode.toTypeMappingMode(
type: KtType,
isAnnotationMethod: Boolean,