Remove child index for inherited equation on parameterized NTA child

Issue #205 resolved
Jesper Öqvist created an issue

The child index for parameterized NTA equations is not useful because it is dependent on the evaluation order of different parameter values of the parameterized NTA.

For example:

// ASPECT CODE
  syn nta B A.selectB(int i) = new B();

  inh int B.value();
  eq A.selectB(int i).value() = i;


// TEST CODE
  testEqual(0, a.selectB(2).value());
  testEqual(1, a.selectB(1).value());
  testEqual(2, a.selectB(0).value());
  testEqual(3, a.selectB(1000).value());
  testEqual(4, a.selectB(-711).value());
  testEqual(5, a.selectB(0xBEEF).value());

In the above example it is easy to see that this feature is probably bad because you can easily be fooled to believe that the integer parameter to the inherited equation is the same as the integer parameter to the parameterized attribute.

Comments (5)

  1. Jesper Öqvist reporter

    Other existing test cases testing this issue:

    • inh/nta_01p - same as the example given in the issue description.
    • inh/nta_02p - test that an inherited equation can be declared for a parameterized NTA without declaring a parameter.
  2. Jesper Öqvist reporter

    Disable child index in inh eq for param NTA

    Inherited equations for parameterized NTAs can no longer use a child index parameter.

    fixes #205 (bitbucket)

    → <<cset 2050959e6103>>

  3. Log in to comment