guppylang icon indicating copy to clipboard operation
guppylang copied to clipboard

Better error message when using Python `TypeVar`

Open mark-koch opened this issue 1 year ago • 0 comments

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.

mark-koch avatar May 15 '24 10:05 mark-koch