Skip to content

TP0202

Error: cannot assign to let binding

  • cannot assign to '<x>': it is a <let binding|parameter|loop variable|constant|function|method>, with help declare it with 'var' for a let binding
  • cannot assign to an element of str
  • cannot assign to an element of a tuple
  • cannot use '<op>' on a slice
  • cannot delete '<x>', with help assign it a new value instead
  • cannot delete a field
  • cannot delete an element of <T> (M26)
  • cannot assign to '<p>': it is a read-only property
  • cannot assign to '<a>' through '<x>', with help assign '<C>.<a>' (M28)
  • cannot assign to '<f>': '<C>' is frozen (M39)

From the golden case tests/cases/m11/tp0202_functions.tpn:

tp0202_functions.tpn
def outer():
def inner():
pass
inner = outer

The compiler reports:

tp0202_functions.tpn:4:5: error TP0202: cannot assign to 'inner': it is a function

The specification lists every code.