Previously they were enumerated in the opposite order, i.e.
descendant fields had lower indexes than their parents. Existing tests
didn't caught that problem because I misinterpreted the method
UsefulTestCase#assertSameElements(), should have used
UsefulTestCase#assertOrderedEquals() instead.
As a fallback value PySubstitutionChunkReference resolves into the
right operand of "%" operator whenever it cannot find individual
expressions for multiple positional formatted fields or a field with
a key. I explicitly check and suppress the intention for such cases.
In future it's better to introduce some sort of "strict resolve"
semantic in the PySubstitutionChunkReference so as do these checks
twice.
Namely, allow lookup items that contain quotes in some cases if the
containing string literal is multiline, hence there is still a suitable
type of quotes to wrap injected string literal into.
The orignal error described in the issue has been fixed earlier as
part of other changes for PY-21161.