That is an expected behavior, since consts can be assigned value only once. In your case you use your one chance when you assign 0 to it. After that it become read-only.