<@U2WH3L3TJ> if you want to perform effects up unt...
# announcements
r
@pablisco if you want to perform effects up until a given condition you can try
takeWhile
which stops when the predicate is no longer valid, then with the resulting list you can call
forEach
p
I wrote it like this:
Copy code
private fun typeEquals(from: ParameterizedType, to: ParameterizedType, typeVarMap: Map<String, Type>): Boolean =
    if (from.rawType == to.rawType) {
        from.actualTypeArguments
            .zip(to.actualTypeArguments)
            .all { (from, to) -> matches(from, to, typeVarMap) }
    } else {
        false
    }
Should work right?