artiq/artiq/test/lit/inferencer
Jonathan Coates 5c85cef0c2
Allow indexing tuples in kernel code
This only allows for indexing with a constant value (e.g. x[0]).

While slices would be possible to implement, it's not clear how to
preserve type inference here. The current typing rule is:

  Γ ⊢ x : τ  Γ ⊢ a : Int  Γ ⊢ b : Int
  ------------------------------------
             Γ ⊢ x[a:b] : τ

However, tuples would require a different typing rule, and so we'd need
to defer type inference if τ is a tyvar. I'm not confident that this
won't change behaviour, so we leave as-is for now.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-09-12 14:43:38 +01:00
..
array_creation.py compiler: Change type inference rules for empty array() calls 2021-03-14 22:48:43 +00:00
builtin_calls.py compiler: Implement abs() for scalars 2019-04-13 13:39:16 +08:00
cast.py compiler: add test for int64(round(1.0)). 2018-05-14 15:57:27 +00:00
class.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
coerce.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
coerce_explicit.py compiler: do not try to re-coerce fully coerced numerics. 2018-04-21 18:25:52 +00:00
error_array.py compiler: Properly implement NumPy array slicing 2021-03-14 20:02:59 +00:00
error_array_augassign.py compiler: Add test for disallowing type-unstable array-assign binops 2021-01-12 03:02:07 +01:00
error_array_ops.py compiler: Add inferencer support for array operations 2020-08-09 03:54:41 +01:00
error_assert.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_builtin_calls.py compiler: Implement abs() for scalars 2019-04-13 13:39:16 +08:00
error_bytes_subscript_mut.py compiler: do not permit mutation of bytes values (#714). 2017-06-09 07:29:28 +00:00
error_call.py compiler: reject calls with unexpected keyword arguments. 2018-02-21 11:37:12 +00:00
error_class.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_class_redefine.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_coerce.py inferencer: significantly improve the op-assignment diagnostic. 2016-11-21 14:20:24 +00:00
error_comprehension.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_control_flow.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_exception.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_iterable.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_local_unbound.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_locals.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
error_matmult.py compiler: Support MatMult in inferencer 2020-08-09 03:54:42 +01:00
error_method.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_return.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_str_iter.py compiler: do not permit iterating str values. 2017-06-09 07:29:31 +00:00
error_subscript.py compiler: Fix multi-dim slice error message test, tweak wording 2020-08-09 23:14:56 +01:00
error_tuple_index.py Allow indexing tuples in kernel code 2023-09-12 14:43:38 +01:00
error_unify.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_with_arity.py Commit missing parts of 919a49b6. 2016-02-25 20:02:31 +00:00
error_with_exn.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_with_many.py Rename 'with parallel' to 'with interleave' (#265). 2016-02-22 13:24:43 +00:00
error_with_self.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
error_with_var.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
exception.py lit-test: move to artiq/test 2016-01-18 15:28:24 -07:00
gcd.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
if_expr.py compiler: Fix type inference for "ternary" if expressions 2021-03-20 00:27:25 +00:00
matmult.py compiler: Support MatMult in inferencer 2020-08-09 03:54:42 +01:00
prelude.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
scoping.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
slice.py compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
unify.py test/lit: Fix invalid type inference test 2021-03-21 01:46:52 +00:00
with.py Rename 'with parallel' to 'with interleave' (#265). 2016-02-22 13:24:43 +00:00