From 9b62b97765ffc2db805e3be4853515268ba55cda Mon Sep 17 00:00:00 2001 From: Marco Eilers Date: Tue, 12 Sep 2023 00:57:50 +0200 Subject: [PATCH] De-prioritize singleton chunks when we know none of them definitely fits --- src/main/scala/rules/QuantifiedChunkSupport.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/rules/QuantifiedChunkSupport.scala b/src/main/scala/rules/QuantifiedChunkSupport.scala index 09f1dca3b..67211833f 100644 --- a/src/main/scala/rules/QuantifiedChunkSupport.scala +++ b/src/main/scala/rules/QuantifiedChunkSupport.scala @@ -1761,7 +1761,9 @@ object quantifiedChunkSupporter extends QuantifiedChunkSupport { if (greedyMatch.nonEmpty) { greedyMatch ++ chunks.diff(greedyMatch) } else { - fallback(chunks) + // It doesn't seem to be any of the singletons. Use the fallback on the non-singletons. + val (qpChunks, singletons) = chunks.partition(_.singletonArguments.isEmpty) + fallback(qpChunks) ++ singletons } } }