DavidKinder / Inform6

The latest version of the Inform 6 compiler, used for generating interactive fiction games.
http://inform-fiction.org/
Other
199 stars 32 forks source link

Problem with RL__Pr #220

Closed fredrikr closed 1 year ago

fredrikr commented 1 year ago

Checking the length of a common property of a superclass gives the wrong result for v3. This is because RL__Pr is used for this, and it doesn't handle v3. If you put a print statment in RL__Pr, you can see that's it's being called, even though the function header says it's only used for individual properties.

To reproduce the problem, compile this for v3 with PunyInform. I used compiler v6.41 and applied the fixes for issue #215 manually before trying this, but using the very latest compiler version with issue #215 fixed should have the same effect.

Include "globals";
Include "puny";

Property prop_a;
Property prop_b;
Property individual iprop_c;
Property individual iprop_d;

Class Foo
    with
        description "hello 1" "hello 2" "hello 3",
        prop_a 1 2 3 4,
        prop_b 5 6 7,
        iprop_c 10000 2 3 4,
        iprop_d 5 6 7;

Foo Bar
  with
    description "hello x" "hello y",
    prop_a 1 2,
    prop_b 3 4,
    iprop_c 1 2,
    iprop_d 3 4;

[ Initialise;
    print "description: ", Bar.#Foo::description, "^";
    print "prop_a: ", Bar.#Foo::prop_a, "^";
    print "prop_b: ", Bar.#Foo::prop_b, "^";
    print "iprop_c: ", Bar.#Foo::iprop_c, "^";
    print "iprop_d: ", Bar.#Foo::iprop_d, "^";
];
erkyrath commented 1 year ago

Thanks for the detailed test case.