boolean (@NotNull PyUnionType expected, @NotNull PyType actual, @NotNull MatchContext context) { if (expected.getMembers().contains(actual)) { return true; } return ContainerUtil.or(expected.getMembers(), type -> match(type, actual, context).orElse(true)); }