FIR Java: map classes to make java type-parameters have correct bounds

Really, this commit implements early J2K mapping for all Java types.
It's questionable and probably wrong at least for super-types,
because, for example, we cannot resolve spliterator() in classes
derived from java.lang.Iterable
This commit is contained in:
Simon Ogorodnik
2019-04-23 04:22:12 +03:00
committed by Mikhail Glukhikh
parent cb91c6b977
commit 3e69838f48
279 changed files with 338 additions and 337 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.java
import org.jetbrains.kotlin.builtins.jvm.JavaToKotlinClassMap
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.fir.FirSession
@@ -142,7 +143,9 @@ internal fun JavaClassifierType.toConeKotlinTypeWithNullability(
): ConeLookupTagBasedType {
return when (val classifier = classifier) {
is JavaClass -> {
val classId = classifier.classId!!
//val classId = classifier.classId!!
val classId = JavaToKotlinClassMap.mapJavaToKotlin(classifier.fqName!!) ?: classifier.classId!!
val lookupTag = ConeClassLikeLookupTagImpl(classId)
lookupTag.constructClassType(
typeArguments.mapIndexed { index, argument ->