From bd79cebff8515e9c6e30ccffb9af7ac14352716c Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Wed, 1 Feb 2023 19:51:22 +0000 Subject: [PATCH] Backport of #162 (#163) --- .../internal/deepembedding/backend/SequenceEmbedding.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala index affb5ef17..f80166eeb 100644 --- a/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala +++ b/parsley/shared/src/main/scala/parsley/internal/deepembedding/backend/SequenceEmbedding.scala @@ -185,7 +185,7 @@ private [deepembedding] final class Seq[A](private [backend] var before: DoublyL after.clear() mergeFromRight(p, chooseInto(r)) // shift pure to the right by swapping before and after (before is empty linked list!) - case (_: Pure[_]) <** _ => + case (_: Pure[_]) <* _ => assume(before.isEmpty, "empty can reuse before instead of allocating a new list because before is empty") val empty = before before = after