Pass JvmTarget to KotlinTypeMapper

Also use KotlinTypeMapper.RELEASE_COROUTINES_DEFAULT instead of false in
FileRankingCalculator
This commit is contained in:
Alexander Udalov
2018-06-15 14:21:17 +02:00
parent f3e0470dcd
commit b7808ba24d
8 changed files with 31 additions and 31 deletions
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.codegen.ClassBuilderMode
import org.jetbrains.kotlin.codegen.state.IncompatibleClassTracker
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
import org.jetbrains.kotlin.config.JvmTarget
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
import org.jetbrains.kotlin.idea.caches.resolve.analyze
@@ -417,7 +418,10 @@ abstract class FileRankingCalculator(
}
private fun makeTypeMapper(bindingContext: BindingContext): KotlinTypeMapper {
return KotlinTypeMapper(bindingContext, ClassBuilderMode.LIGHT_CLASSES, IncompatibleClassTracker.DoNothing, "debugger", false)
return KotlinTypeMapper(
bindingContext, ClassBuilderMode.LIGHT_CLASSES, IncompatibleClassTracker.DoNothing, "debugger", JvmTarget.DEFAULT,
KotlinTypeMapper.RELEASE_COROUTINES_DEFAULT, false
)
}
companion object {
@@ -429,4 +433,4 @@ private fun String.simpleName() = substringAfterLast('.').substringAfterLast('$'
private fun PsiElement.getLine(): Int {
return DiagnosticUtils.getLineAndColumnInPsiFile(containingFile, textRange).line
}
}