Get rid of passing typeChecker from the call hierarchy

This commit is contained in:
Mikhail Zarechenskiy
2017-09-01 14:15:30 +03:00
parent e7449a3584
commit 0dc29d6d7e
11 changed files with 27 additions and 33 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -255,7 +255,7 @@ private fun KtNamedDeclaration.guessType(context: BindingContext): Array<KotlinT
if (expectedTypes.isEmpty() || expectedTypes.any { expectedType -> ErrorUtils.containsErrorType(expectedType) }) {
return arrayOf()
}
val theType = TypeIntersector.intersectTypes(KotlinTypeChecker.DEFAULT, expectedTypes)
val theType = TypeIntersector.intersectTypes(expectedTypes)
return if (theType != null) {
arrayOf(theType)
}
@@ -66,7 +66,6 @@ import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsStatement
import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.typeUtil.makeNullable
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.DFS.*
@@ -514,7 +513,7 @@ internal class MutableParameter(
private val defaultType: KotlinType by lazy {
writable = false
if (defaultTypes.isNotEmpty()) {
TypeIntersector.intersectTypes(KotlinTypeChecker.DEFAULT, defaultTypes)!!
TypeIntersector.intersectTypes(defaultTypes)!!
}
else originalType
}