[java] [inference]: avoid recursion guards in clients as they may prevent engine code to complete normally (IDEA-268120)

here highlighting got guarded and inference was unable to walk up to the containing call and failed because of that. Guard is needed for the case when the same code may be invoked *during* inference itself, corresponding guard exists already and mentioned in javadoc

GitOrigin-RevId: bdb8ba5056884d1b6869bd0d31c8482f77adb3a7
This commit is contained in:
Anna Kozlova
2021-05-27 13:24:01 +02:00
committed by intellij-monorepo-bot
parent f379784ad1
commit e287fd7576
5 changed files with 49 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
import java.util.function.Function;
class MyTest {
void m(Try<String> t) {
t.andThen(v -> fa<caret>il());
}
private static <V> V fail() {
return null;
}
}
interface Try<K> {
<U> void andThen(Function<K, Try<U>> function);
}