- for(int i=0; i<expansion.length; i++) {
- if (!drops[i]) idx = i;
- else expansion[i] = expansion[i];
- }
- ret = idx==-1 ? Sequence.drop(expansion, and, not, false) : Sequence.singleton(expansion, idx, and, not);
+ for(int i=0; i<expansion.length; i++)
+ if (!drops[i])
+ if (idx==-1) idx = i;
+ else throw new Error("multiple non-dropped elements in sequence: " + Sequence.drop(expansion,null,null,false));
+ if (idx != -1) return Sequence.singleton(expansion, idx, and, not);
+ return Sequence.drop(expansion, and, not, false);