diff --git a/meshmode/dof_array.py b/meshmode/dof_array.py
index 12ffe33fb19f83e3a38a10f52d434166ccd93e79..f4099b33e9d64976d8e98c3dbfcb8ec01f661b1a 100644
--- a/meshmode/dof_array.py
+++ b/meshmode/dof_array.py
@@ -21,7 +21,7 @@ THE SOFTWARE.
 """
 
 import numpy as np
-from typing import Optional, Iterable, TYPE_CHECKING
+from typing import Optional, Iterable, TYPE_CHECKING, Any
 from functools import partial
 
 from pytools import single_valued, memoize_in
@@ -170,7 +170,7 @@ def freeze(ary: np.ndarray) -> np.ndarray:
         ])
 
 
-def flatten(ary: np.ndarray) -> np.ndarray:
+def flatten(ary: np.ndarray) -> Any:
     r"""Convert a :class:`DOFArray` into a "flat" array of degrees of freedom,
     where the resulting type of the array is given by the
     :attr:`DOFArray.array_context`.