[NI] Move most of KotlinCallDiagnostic to one file

Now there is 3 kind of KotlinCallDiagnostic:
  - ResolutionDiagnostic
  - ConstraintSystemCallDiagnostic
  - other common diagnostic

Also SpecialResolutionParts were merged into other ResolutionParts
This commit is contained in:
Stanislav Erokhin
2017-06-23 06:31:01 +03:00
committed by Mikhail Zarechenskiy
parent 9378bff65c
commit ef93088a42
11 changed files with 186 additions and 191 deletions
@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.diagnostics.Errors.BadNamedArgumentsTarget.*
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.BindingTrace
import org.jetbrains.kotlin.resolve.calls.components.*
import org.jetbrains.kotlin.resolve.calls.context.BasicCallResolutionContext
import org.jetbrains.kotlin.resolve.calls.inference.model.*
import org.jetbrains.kotlin.resolve.calls.model.*
@@ -123,7 +122,7 @@ class DiagnosticReporterByTrackingStrategy(
}
private fun reportSmartCast(smartCastDiagnostic: SmartCastDiagnostic) {
val expressionArgument = smartCastDiagnostic.expressionArgument
val expressionArgument = smartCastDiagnostic.argument
if (expressionArgument is ExpressionKotlinCallArgumentImpl) {
val context = context.replaceDataFlowInfo(expressionArgument.dataFlowInfoBeforeThisArgument)
val argumentExpression = KtPsiUtil.getLastElementDeparenthesized(expressionArgument.valueArgument.getArgumentExpression (), context.statementFilter)
@@ -143,7 +142,7 @@ class DiagnosticReporterByTrackingStrategy(
private fun reportUnstableSmartCast(unstableSmartCast: UnstableSmartCast) {
// todo hack -- remove it after removing SmartCastManager
reportSmartCast(SmartCastDiagnostic(unstableSmartCast.expressionArgument, unstableSmartCast.targetType))
reportSmartCast(SmartCastDiagnostic(unstableSmartCast.argument, unstableSmartCast.targetType))
}
override fun constraintError(diagnostic: KotlinCallDiagnostic) {