Skip to content

Commit 9e6bb77

Browse files
Fix (#4)
1 parent ff17885 commit 9e6bb77

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

directive-handler/src/main/scala/scala/cli/directivehandler/DirectiveHandlers.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ final case class DirectiveHandlers[T](
4747
)
4848

4949
def ++(other: DirectiveHandlers[T]): DirectiveHandlers[T] =
50-
if (other.handlers.isEmpty) this
51-
else if (handlers.isEmpty) other
52-
else DirectiveHandlers(handlers ++ other.handlers)
50+
DirectiveHandlers(
51+
handlers = handlers ++ other.handlers,
52+
customHandler = key => customHandler(key).orElse(other.customHandler(key))
53+
)
5354

5455
def addCustomHandler(f: String => Option[DirectiveHandler[T]]): DirectiveHandlers[T] =
5556
copy(

0 commit comments

Comments
 (0)