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(
baseType: SimpleTypeMarker,
constructor: TypeConstructorMarker
@@ -151,4 +151,14 @@ enum class CaptureStatus {
FOR_SUBTYPING,
FOR_INCORPORATION,
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
}