Merge pull request #9733 from tausbn/python-fix-bad-mro-flatten-list-join

Python: Fix bad join in MRO `flatten_list`
This commit is contained in:
yoff
2022-06-29 13:29:48 +02:00
committed by GitHub

View File

@@ -386,10 +386,10 @@ private class ClassListList extends TClassListList {
private ClassList flatten_list(ClassListList list, int n) {
need_flattening(list) and
exists(ClassList head, ClassListList tail | list = ConsList(head, tail) |
exists(ClassList head, ClassListList tail | pragma[only_bind_out](list) = ConsList(head, tail) |
n = head.length() and result = tail.flatten()
or
result = Cons(head.getItem(n), flatten_list(list, n + 1))
result = Cons(head.getItem(n), flatten_list(pragma[only_bind_out](list), n + 1))
)
}