Fix the handling of special types in type variables.

- Allow the syntax "specials=True" to indicate that a type variable can
  assume all special types. Use this for the unconstrained type variable
  created in ast.py.
- Fix TypeSet.copy() to avoid deepcopy() which doesn't do the right
  thing for the self.specials set.
- Fix TypeSet.typeset_key() to just use the name of special types
  instead of the full SpecialType objects.
This commit is contained in:
Jakob Stoklund Olesen
2018-01-16 10:26:13 -08:00
parent 85aab278dd
commit ce4cc8ce12
2 changed files with 35 additions and 15 deletions

View File

@@ -247,7 +247,8 @@ class Var(Atom):
'typeof_{}'.format(self),
'Type of the pattern variable `{}`'.format(self),
ints=True, floats=True, bools=True,
scalars=True, simd=True, bitvecs=True)
scalars=True, simd=True, bitvecs=True,
specials=True)
self.original_typevar = tv
self.typevar = tv
return self.typevar