guppylang
guppylang copied to clipboard
Better error message when using Python `TypeVar`
Type variables need to be declared via guppy.type_var(module, "T"). We should point users to this when they try to use a vanilla Python TypeVar instead.
See https://github.com/CQCL/guppylang/pull/210#discussion_r1598357444
This requires holding on to the Python scope in more places. In particular, we need to extract the Python scope when defining a struct/enum.