From ef9da97b63357008be26bfe9fa119232f60c3b2a Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Thu, 10 Jun 2021 11:05:54 -0500
Subject: [PATCH] Move all-containers-are-same assertion in
 _multimap_array_container_impl

---
 arraycontext/container/traversal.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arraycontext/container/traversal.py b/arraycontext/container/traversal.py
index 2ceb9f9..03587b5 100644
--- a/arraycontext/container/traversal.py
+++ b/arraycontext/container/traversal.py
@@ -101,14 +101,14 @@ def _multimap_array_container_impl(
     """
     def rec(*_args: Any) -> Any:
         template_ary = _args[container_indices[0]]
-        assert all(
-                type(_args[i]) is type(template_ary) for i in container_indices[1:]
-                ), f"expected type '{type(template_ary).__name__}'"
-
         if (type(template_ary) is leaf_cls
                 or not is_array_container(template_ary)):
             return f(*_args)
 
+        assert all(
+                type(_args[i]) is type(template_ary) for i in container_indices[1:]
+                ), f"expected type '{type(template_ary).__name__}'"
+
         result = []
         new_args = list(_args)
 
-- 
GitLab