Specify missing type arguments to fix compilation

This commit is contained in:
Sergey Rostov
2019-04-26 12:00:16 +03:00
parent 5b33e54f77
commit 911a5bdd0e
5 changed files with 13 additions and 9 deletions
@@ -47,7 +47,11 @@ private fun SpecTestCase.save(
} }
fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet { fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet {
val testCasesSet = SpecTestCasesSet(mutableMapOf(), mutableMapOf(), mutableMapOf()) val testCasesSet = SpecTestCasesSet(
mutableMapOf<String, TestCasesByNumbers>(),
mutableMapOf<String, NavigableMap<Int, TestCasesByNumbers>>(),
mutableMapOf<Int, SpecTestCase>()
)
var rangeOffset = 0 var rangeOffset = 0
for ((filename, fileContent) in testFiles) { for ((filename, fileContent) in testFiles) {
@@ -55,8 +59,8 @@ fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet {
var startFind = 0 var startFind = 0
if (!testCasesSet.byFiles.contains(filename)) { if (!testCasesSet.byFiles.contains(filename)) {
testCasesSet.byFiles[filename] = mutableMapOf() testCasesSet.byFiles[filename] = mutableMapOf<Int, SpecTestCase>()
testCasesSet.byRanges[filename] = TreeMap() testCasesSet.byRanges[filename] = TreeMap<Int, TestCasesByNumbers>()
} }
val testCasesOfFile = testCasesSet.byFiles[filename]!! val testCasesOfFile = testCasesSet.byFiles[filename]!!
@@ -111,7 +111,7 @@ internal class GenericBoundType(
internal class LiteralBoundType(val isNull: Boolean) : BoundType { internal class LiteralBoundType(val isNull: Boolean) : BoundType {
override val classReference = LiteralClassReference override val classReference = LiteralClassReference
override val typeParameters = emptyList() override val typeParameters: List<BoundTypeTypeParameter> = emptyList()
override val forcedNullabilityTo: Nullability? = null override val forcedNullabilityTo: Nullability? = null
} }
@@ -174,7 +174,7 @@ internal data class BoundTypeTypeParameter(
internal object StarProjectionBoundType : BoundType { internal object StarProjectionBoundType : BoundType {
override val classReference = UnknownClassReference("*")//TODO override val classReference = UnknownClassReference("*")//TODO
override val typeParameters = emptyList() override val typeParameters: List<BoundTypeTypeParameter> = emptyList()
override val forcedNullabilityTo = null override val forcedNullabilityTo = null
} }
@@ -412,7 +412,7 @@ class JavaToJKTreeBuilder constructor(
return qualifierExpression?.toJK() ?: JKStubExpressionImpl() return qualifierExpression?.toJK() ?: JKStubExpressionImpl()
} }
val symbol = symbolProvider.provideSymbol(this) val symbol = symbolProvider.provideSymbol<JKSymbol>(this)
return when (symbol) { return when (symbol) {
is JKClassSymbol -> JKClassAccessExpressionImpl(symbol) is JKClassSymbol -> JKClassAccessExpressionImpl(symbol)
is JKFieldSymbol -> JKFieldAccessExpressionImpl(symbol) is JKFieldSymbol -> JKFieldAccessExpressionImpl(symbol)
@@ -677,7 +677,7 @@ class JavaToJKTreeBuilder constructor(
fun PsiAnnotation.toJK(): JKAnnotation = fun PsiAnnotation.toJK(): JKAnnotation =
JKAnnotationImpl( JKAnnotationImpl(
symbolProvider.provideSymbol(nameReferenceElement!!).safeAs<JKClassSymbol>() symbolProvider.provideSymbol<JKSymbol>(nameReferenceElement!!).safeAs<JKClassSymbol>()
?: JKUnresolvedClassSymbol(nameReferenceElement!!.text), ?: JKUnresolvedClassSymbol(nameReferenceElement!!.text),
parameterList.attributes.map { parameter -> parameterList.attributes.map { parameter ->
if (parameter.nameIdentifier != null) { if (parameter.nameIdentifier != null) {
@@ -51,7 +51,7 @@ internal inline fun sequentialPipe(crossinline configure: PipelineConversionBuil
internal inline fun batchPipe(crossinline configure: PipelineConversionBuilder<BatchBaseConversion>.() -> Unit): BatchPipelineConversion { internal inline fun batchPipe(crossinline configure: PipelineConversionBuilder<BatchBaseConversion>.() -> Unit): BatchPipelineConversion {
return BatchPipelineConversion( return BatchPipelineConversion(
PipelineConversionBuilder().apply(configure).conversions PipelineConversionBuilder<BatchBaseConversion>().apply(configure).conversions
) )
} }
@@ -308,7 +308,7 @@ fun JKSymbol.deepestFqName(): String? {
when (this) { when (this) {
is PsiMethod -> (findDeepestSuperMethods().firstOrNull() ?: this).getKotlinFqName()?.asString() is PsiMethod -> (findDeepestSuperMethods().firstOrNull() ?: this).getKotlinFqName()?.asString()
is KtNamedFunction -> findDeepestSuperMethodsNoWrapping(this).firstOrNull()?.getKotlinFqName()?.asString() is KtNamedFunction -> findDeepestSuperMethodsNoWrapping(this).firstOrNull()?.getKotlinFqName()?.asString()
is JKMethod -> psi()?.deepestFqNameForTarget() is JKMethod -> psi<PsiElement>()?.deepestFqNameForTarget()
else -> null else -> null
} }
return target.deepestFqNameForTarget() ?: fqName return target.deepestFqNameForTarget() ?: fqName