The provided application code causes the compiler to hang during model-to-model stage.

When (length = 20) is removed -> no loop

When converted back to simple prop (i.e. remove := "loop") -> no loop

The expression used as derived property (expr: "loop") might be any other expression, like a function call. It will still loop infinitely.

A thread dump and some debugging learns me that it tries to rename various identifiers, which seem to trigger renaming of other identifiers, which in turn tries to rename the initial identifier again etc.

application test

  entity A{
      derivedProp :: String  (length = 20) := "loop"
  }
  define page root(){}
Submitted by Elmer van Chastelet on 6 October 2012 at 20:52

On 9 October 2012 at 11:53 Christoffer Gersen commented:

desugar-entity-validation sees that no validation function is generated for the length anno, so it starts to generate validation functions for that entity, but validation functions are not generated for a DerivedProperty, so no validation function is generated and the desugar rule keeps succeeding and also keeps calling rename.


On 9 October 2012 at 12:03 Danny Groenewegen commented:

length annotation on a derived property should be reported as an error, it implies validation on something that is never an input


On 9 October 2012 at 12:07 Elmer van Chastelet commented:

Good point. And derived props never get stored. I knew that this prop would grow beyond the default string length, but for derived props it’s not needed to increase the length by anno. So it’s kinda useless.

Log in to post comments