Extract TypeArgumentListMarker.all

This commit is contained in:
Simon Ogorodnik
2019-03-14 17:46:15 +03:00
parent d9c40c24ed
commit 2118f6008a
2 changed files with 10 additions and 11 deletions
@@ -328,17 +328,6 @@ object AbstractTypeChecker {
} }
private inline fun TypeArgumentListMarker.all(
context: AbstractTypeCheckerContext,
crossinline predicate: (TypeArgumentMarker) -> Boolean
): Boolean = with(context) {
repeat(size()) { index ->
if (!predicate(get(index))) return false
}
return true
}
private fun AbstractTypeCheckerContext.collectAllSupertypesWithGivenTypeConstructor( private fun AbstractTypeCheckerContext.collectAllSupertypesWithGivenTypeConstructor(
baseType: SimpleTypeMarker, baseType: SimpleTypeMarker,
constructor: TypeConstructorMarker constructor: TypeConstructorMarker
@@ -152,3 +152,13 @@ enum class CaptureStatus {
FOR_INCORPORATION, FOR_INCORPORATION,
FROM_EXPRESSION FROM_EXPRESSION
} }
inline fun TypeArgumentListMarker.all(
context: TypeSystemContext,
crossinline predicate: (TypeArgumentMarker) -> Boolean
): Boolean = with(context) {
repeat(size()) { index ->
if (!predicate(get(index))) return false
}
return true
}