FIR: Convert couple of methods to block-body
This commit is contained in:
committed by
teamcityserver
parent
7c05c6420a
commit
36c9418d55
+6
-2
@@ -163,7 +163,8 @@ private fun mapSystemHasContradictionError(
|
|||||||
diagnostic: ConeConstraintSystemHasContradiction,
|
diagnostic: ConeConstraintSystemHasContradiction,
|
||||||
source: FirSourceElement,
|
source: FirSourceElement,
|
||||||
qualifiedAccessSource: FirSourceElement?,
|
qualifiedAccessSource: FirSourceElement?,
|
||||||
): List<FirDiagnostic<FirSourceElement>> = buildList<FirDiagnostic<FirSourceElement>> {
|
): List<FirDiagnostic<FirSourceElement>> {
|
||||||
|
return buildList<FirDiagnostic<FirSourceElement>> {
|
||||||
for (error in diagnostic.candidate.system.errors) {
|
for (error in diagnostic.candidate.system.errors) {
|
||||||
addIfNotNull(error.toDiagnostic(source, qualifiedAccessSource, diagnostic.candidate.callInfo.session.typeContext))
|
addIfNotNull(error.toDiagnostic(source, qualifiedAccessSource, diagnostic.candidate.callInfo.session.typeContext))
|
||||||
}
|
}
|
||||||
@@ -180,12 +181,14 @@ private fun mapSystemHasContradictionError(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun ConstraintSystemError.toDiagnostic(
|
private fun ConstraintSystemError.toDiagnostic(
|
||||||
source: FirSourceElement,
|
source: FirSourceElement,
|
||||||
qualifiedAccessSource: FirSourceElement?,
|
qualifiedAccessSource: FirSourceElement?,
|
||||||
typeContext: ConeTypeContext,
|
typeContext: ConeTypeContext,
|
||||||
): FirDiagnostic<FirSourceElement>? = when (this) {
|
): FirDiagnostic<FirSourceElement>? {
|
||||||
|
return when (this) {
|
||||||
is NewConstraintError -> {
|
is NewConstraintError -> {
|
||||||
val position = position.from
|
val position = position.from
|
||||||
val argument =
|
val argument =
|
||||||
@@ -224,6 +227,7 @@ private fun ConstraintSystemError.toDiagnostic(
|
|||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private val NewConstraintError.lowerConeType: ConeKotlinType get() = lowerType as ConeKotlinType
|
private val NewConstraintError.lowerConeType: ConeKotlinType get() = lowerType as ConeKotlinType
|
||||||
private val NewConstraintError.upperConeType: ConeKotlinType get() = upperType as ConeKotlinType
|
private val NewConstraintError.upperConeType: ConeKotlinType get() = upperType as ConeKotlinType
|
||||||
|
|||||||
Reference in New Issue
Block a user