Table of Contents

The variable "{0}" cannot be assigned to outside of a constructor cause it is marked as readonly. (AJTERR10024)

Product(s) Karo.NET Compiler

Description

It isn't possible to assign to a variable marked with the sl.attributes::readOnly attribute.

[private]
[readOnly]
test: int = 1;

testMethod ||: void {
   10 -> test;
   //    ^^^^ Tried assigning to a readonly variable.
}

How can I resolve this error?

Remove the sl.attributes::readOnly attribute or avoid assigning to it.