artiq/artiq
Jonathan Coates cc81464f53 Fix type annotations with mixed tuples
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>
2023-09-27 10:27:05 +08:00
..
applets applets.simple: Actually forward dataset_prefixes when using IPC 2022-06-19 18:08:25 +01:00
browser browser: tolerate missing HDF5 metadata 2022-12-02 16:31:47 +08:00
compiler Fix type annotations with mixed tuples 2023-09-27 10:27:05 +08:00
coredevice mirny: fix minor doc formatting 2023-09-06 15:52:56 +08:00
dashboard gui/experiments: cast Qt timestamp to int preventing float type error 2023-07-14 16:34:09 +08:00
examples add aqctl_moninj_proxy to device dbs 2022-03-19 19:25:21 +08:00
firmware Fix panic when receiving empty strings in rpc calls 2023-07-18 12:01:25 +08:00
frontend Revert "language: check_unprocessed_arguments after constructing experiment" 2022-11-30 07:44:57 +08:00
gateware kasli-soc: fix GTX initialization 2023-07-13 16:37:14 +08:00
gui applets: Allow wildcard subscription to all datasets matching prefix via IPC 2022-06-18 15:45:57 +08:00
language typo 2022-07-21 11:58:36 +08:00
master worker: Wait until datasets are written before quitting 2023-05-24 06:58:15 +08:00
sim ttl: Add target RTIO time argument to timestamp/count functions 2018-11-03 20:33:19 +08:00
test Fix type annotations with mixed tuples 2023-09-27 10:27:05 +08:00
wavesynth wavesynth: np.int is deprecated 2021-09-13 07:02:35 +08:00
__init__.py simplify versioneer 2020-07-30 00:54:07 +08:00
_version.py fix default version string 2023-04-22 09:36:07 +08:00
afws.pem add AFWS client 2022-02-07 14:28:00 +08:00
appdirs.py add appdirs 2016-07-18 16:40:18 +02:00
build_soc.py build_soc: build VexRiscv_G if not kasli v1.x 2021-11-08 16:59:08 +08:00
experiment.py artiq.experiment: merge language and coredevice namespaces 2016-01-25 17:24:00 -07:00
remoting.py artiq_flash: wrap paramiko commands in bash login shell 2021-05-27 21:44:10 +08:00
tools.py tools: fix importlib issue 2021-12-21 13:20:11 +08:00