Browse Source
Fixes issue #7782, and part of issue #6314. Signed-off-by: Damien George <damien@micropython.org>pull/7783/head
Damien George
3 years ago
3 changed files with 24 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||
# test viper with multiple subscripts in a single expression |
|||
|
|||
|
|||
@micropython.viper |
|||
def f1(b: ptr8): |
|||
b[0] += b[1] |
|||
|
|||
|
|||
@micropython.viper |
|||
def f2(b: ptr8, i: int): |
|||
b[0] += b[i] |
|||
|
|||
|
|||
b = bytearray(b"\x01\x02") |
|||
f1(b) |
|||
print(b) |
|||
|
|||
b = bytearray(b"\x01\x02") |
|||
f2(b, 1) |
|||
print(b) |
@ -0,0 +1,2 @@ |
|||
bytearray(b'\x03\x02') |
|||
bytearray(b'\x03\x02') |
Loading…
Reference in new issue