mirror of
https://github.com/m-labs/artiq.git
synced 2025-01-05 16:43:34 +08:00
compiler: add support for concatenating bytes values (#714).
This commit is contained in:
parent
7b2da5294f
commit
778e7dc2ab
@ -396,7 +396,8 @@ class Inferencer(algorithm.Visitor):
|
|||||||
self._unify(left.type, right.type,
|
self._unify(left.type, right.type,
|
||||||
left.loc, right.loc)
|
left.loc, right.loc)
|
||||||
return left.type, left.type, right.type
|
return left.type, left.type, right.type
|
||||||
elif builtins.is_str(left.type) or builtins.is_str(right.type):
|
elif (builtins.is_str(left.type) or builtins.is_str(right.type) or
|
||||||
|
builtins.is_bytes(left.type) or builtins.is_bytes(right.type)):
|
||||||
self._unify(left.type, right.type,
|
self._unify(left.type, right.type,
|
||||||
left.loc, right.loc)
|
left.loc, right.loc)
|
||||||
return left.type, left.type, right.type
|
return left.type, left.type, right.type
|
||||||
|
5
artiq/test/lit/integration/bytes.py
Normal file
5
artiq/test/lit/integration/bytes.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# RUN: %python -m artiq.compiler.testbench.jit %s
|
||||||
|
# RUN: %python %s
|
||||||
|
|
||||||
|
assert b"xy" == b"xy"
|
||||||
|
assert (b"x" + b"y") == b"xy"
|
Loading…
Reference in New Issue
Block a user