Consider the following:
function* makeIterable() {
yield 1;
}
match({ iterable: makeIterable() }) {
when let subject and { iterable: let iter } and iter is [1] and if(subject.iterable is [1]): console.log("fully cached");
when { iterable: let iter } and iter is [1] and if(iter is [1]): console.log("partially cached");
default: console.log("uncached");
}
What will be logged—"fully cached" because the if expression uses the cached results for both getting subject.iterable and for getting an iterator for that, "partially cached" because the if expression does not use cached results for the first Get but still remembers results from the iterator, or "uncached" because e.g. the if expression is independent of caching?