2
0
mirror of https://github.com/m-labs/artiq.git synced 2025-01-22 08:36:42 +08:00
artiq/artiq/test
Jonathan Coates 586d97c6cb 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-26 23:43:01 +01:00
..
compiler assume 'import artiq' works before running tests 2016-02-02 21:52:33 +01:00
coredevice test_embedding: Fix up spelling in FIXME comment [nfc] 2022-12-19 01:02:51 +00:00
libartiq_support firmware: runtime changes for exception 2022-01-26 07:16:54 +08:00
lit Fix type annotations with mixed tuples 2023-09-26 23:43:01 +01:00
__init__.py setup: install frontend tools, remove nosetest dependency, minor fixes 2014-12-10 12:13:10 +08:00
hardware_testbench.py test: fix hardware testbench trying to write to ARTIQ_ROOT 2023-04-30 17:16:36 +08:00
test_arguments.py test_arguments: rename ndecimals to precision 2023-07-18 08:02:42 +00:00
test_client.py test: improve tmpdir names 2023-04-30 17:15:34 +08:00
test_datasets.py test_datasets: add metadata tests 2023-07-10 02:33:59 +00:00
test_device_db.py test_device_db: fix on Windows (tempfile access limitations) 2021-06-21 16:47:22 +08:00
test_frontends.py add channel names to RTIO errors 2022-12-02 16:27:03 +08:00
test_h5types.py worker: trust that h5py maps all types as we want 2016-04-05 17:18:15 +08:00
test_scheduler.py test_scheduler: refactor dataset metadata support 2023-07-10 02:33:59 +00:00
test_tools.py tools/file_import: use SourceFileLoader 2021-12-09 11:47:04 +08:00
test_wavesynth.py test_wavesynth: use matplotlib 2016-04-07 21:36:30 +08:00
test_worker.py test_worker: fix asyncio event loop management 2023-01-10 12:36:33 +08:00