[FIR IDE] Suppress warnings to build project with warnings-as-errors mode

This commit is contained in:
Igor Yakovlev
2021-08-17 14:40:45 +02:00
parent 5498f40ce7
commit 5e6442b475
4 changed files with 5 additions and 3 deletions
@@ -13,7 +13,7 @@ internal class FirPhaseRunner {
* We temporary disable multi-locks to fix deadlocks problem
* @see org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.LockProvider
*/
inline fun runPhaseWithCustomResolve(phase: FirResolvePhase, crossinline resolve: () -> Unit) =
inline fun runPhaseWithCustomResolve(@Suppress("UNUSED_PARAMETER") phase: FirResolvePhase, crossinline resolve: () -> Unit) =
runPhaseWithCustomResolveWithoutLock(resolve)
private inline fun runPhaseWithCustomResolveWithoutLock(crossinline resolve: () -> Unit) {
@@ -19,11 +19,11 @@ internal class LockProvider<KEY> {
val globalLock = ReentrantLock()
@OptIn(PrivateForInline::class)
inline fun <R> withWriteLock(key: KEY, action: () -> R): R =
inline fun <R> withWriteLock(@Suppress("UNUSED_PARAMETER") key: KEY, action: () -> R): R =
globalLock.withLock(action)
@OptIn(PrivateForInline::class)
inline fun <R> withWriteLockPCECheck(key: KEY, lockingIntervalMs: Long, action: () -> R): R =
inline fun <R> withWriteLockPCECheck(@Suppress("UNUSED_PARAMETER") key: KEY, lockingIntervalMs: Long, action: () -> R): R =
globalLock.lockWithPCECheck(lockingIntervalMs, action) //We temporary disable multi-locks to fix deadlocks problem
}
@@ -62,6 +62,7 @@ internal fun <D : FirDeclaration> FirLazyDeclarationResolver.lazyResolveDeclarat
}
check(currentDeclaration.returnTypeRef is FirResolvedTypeRef)
@Suppress("UNCHECKED_CAST")
currentDeclaration as D
}
ResolveType.BodyResolveWithChildren, ResolveType.CallableBodyResolve -> {
@@ -312,6 +312,7 @@ internal class FirLazyDeclarationResolver(private val firFileBuilder: FirFileBui
check(realPsi != null) {
"Cannot remap element without PSI"
}
@Suppress("UNCHECKED_CAST")
val firDeclaration = FirElementFinder.findElementIn<FirDeclaration>(firContainer) {
it.realPsi == realPsi
} as? D