curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1528] [Mantis 1564] Sentence verb fails for a property of a KOV #556

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : zarf

Description :

In the code below, the first test works correctly. The second one triggers a run-time error:


Yes (1).

[** Programming error: tried to find the "." of (something) **]

[** Programming error: tried to read (something) **]

Steps to reproduce :

The Kitchen is a room. 

A material is a kind of value. The materials are metal, ceramic, and polymer.
A resistance is a kind of value. The resistances are brittle, hard, and soft.

A material has a resistance called the stiffness.

The verb to feel means the stiffness property.
Metal feels hard. Ceramic feels brittle. Polymer feels soft.

When play begins:
    if the stiffness of metal is hard:
        say "Yes (1).";
    if metal feels hard:  [this test compiles wrong]
        say "Yes (2).";

Additional information :

imported from: [Mantis 1564] Sentence verb fails for a property of a KOV
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-07T04:59:09+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by graham :
Fixed - an important one to catch.

curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by zarf :
In the generated I6, you can see that the compiler is using object property syntax (x.y) even though metal is a KOV.


! [1: if the stiffness of metal is hard begin]
if (((GProperty(52, I126_metal,p15_stiffness) == I131_hard)))

{ ! [2: say ~Yes (1).~] say__p=1;ParaContent(); print "Yes (1)."; new_line; .L_Say1; .L_SayX1; ! [3: end if] }

! [4: if metal feels hard begin]
if (((I126_metal.p15_stiffness == I131_hard)))

{ ! [5: say ~Yes (2).~] say__p=1;ParaContent(); print "Yes (2)."; new_line; .L_Say2; .L_SayX2; ! [6: end if] }