You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's only explicit dispatch constructor/_reify support for tuple, and since NamedTuple's type is a subclass of tuple, it's being interpreted as the latter.
We could attempt to add broader support for subclasses by assuming that their constructors take the same arguments as their base class constructors, but that's bound to fail in some cases, and failure as a default is probably worse than a successful base class result.
brandonwillard
changed the title
Namedtuples reify into tuplesNamedTuples reify into tuples
Jul 6, 2022
While we can unify namedtuples with the same structure,
reify
returns a tuple when passed a namedtuple:Trying to access elements by name obviously fails:
We would expect
reify
to return a namedtuple with the same structure instead.The text was updated successfully, but these errors were encountered: