summaryrefslogtreecommitdiff
path: root/tests/errors/uninitialized_lhs.pyx
blob: 8550761a4f4824b5c584b6f413a1ac722c1aa0be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# cython: warn.maybe_uninitialized=True
# mode: error
# tag: werror
# ticket: t739

def index_lhs(a):
    cdef object idx
    a[idx] = 1

def slice_lhs(a):
    cdef object idx
    a[:idx] = 1

_ERRORS = """
8:6: local variable 'idx' referenced before assignment
12:7: local variable 'idx' referenced before assignment
"""