Skip to content

Commit 56cfb40

Browse files
committed
assert dataclass_array_container fields are not strings
1 parent bec3052 commit 56cfb40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arraycontext/container/dataclass.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def dataclass_array_container(cls: type) -> type:
4848
"""
4949
from dataclasses import is_dataclass
5050
assert is_dataclass(cls)
51+
assert all(not isinstance(f.type, str) for f in fields(cls)), \
52+
"dataclass cannot have string-based type annotations"
5153

5254
array_fields = [
5355
f for f in fields(cls) if is_array_container_type(f.type)]

0 commit comments

Comments
 (0)