Infinite compiler loop when using length annotation on derived property
The provided application code causes the compiler to hang during model-to-model stage.
When
(length = 20)
is removed -> no loopWhen converted back to simple prop (i.e. remove
:= "loop"
) -> no loopThe 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.
Submitted by Elmer van Chastelet on 6 October 2012 at 20:52application test entity A{ derivedProp :: String (length = 20) := "loop" } define page root(){}
Issue Log
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 aDerivedProperty
, so no validation function is generated and the desugar rule keeps succeeding and also keeps calling rename.
length annotation on a derived property should be reported as an error, it implies validation on something that is never an input
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