Mass rollup example from Introduction to the SysML v2 Language

Because of how SysML feature reference evaluation works, features without feature values evaluate to themselves, matching Pilot implementation. The infinite recursion is then due to repeatedly attempting to evaluate subproducts.valueSum as subproducts returns itself instead of null. The fix is to change

part subproducts : RecursiveProduct [*] default null;

In the meantime, found and fixed a bug where feature chainings were evaluated in the outer scope, rather than the left-hand side scope of the chained access. For now, evaluation will still return None due to infinite recursion even with default null but next release will correctly evaluate valueSum to 18.

1 Like