forked from M-Labs/artiq
Jonathan Coates
cc81464f53
The type checker/inferer visits every node in an AST tree, including function return annotations. This means for a function definition like def f() -> TTuple([TInt32, TBool]): ... We attempt to type check the list [TInt32, TBool], which generates the unification constraint builtins.TBool ~ builtins.TInt. This causes an internal error due to compiler weirdness. We can avoid this by just nulling-out the return annotation in the embedding stage. The return type isn't actually used anywhere (it's extracted via the inspect module instead), so this is entirely safe. Arguments aren't affected by this, as we already nulled out the annotation (see visit_arg in embedding.py). Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com> |
||
---|---|---|
.. | ||
applets | ||
browser | ||
compiler | ||
coredevice | ||
dashboard | ||
examples | ||
firmware | ||
frontend | ||
gateware | ||
gui | ||
language | ||
master | ||
sim | ||
test | ||
wavesynth | ||
__init__.py | ||
_version.py | ||
afws.pem | ||
appdirs.py | ||
build_soc.py | ||
experiment.py | ||
remoting.py | ||
tools.py |