final - pannous/wasp GitHub Wiki

final

As with mutability, there are two kinds of constance:

  • constant variables point to the same objects during their lifetime.
  • constant objects don't change (their inner value) during their lifetime.

To simplify the situation, Angle offers the final keyword which means both:

final x = Node()
x = 7 // error can't change variable x
x.y=z // error can't change Node x