curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-2035] [Mantis 2072] Truth state properties accessed without specifier ("the x" rather than "the x of [thing]) always return true #49

Open curiousdannii-testing opened 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : Eleas

Description :

I'm unsure if this is proper behavior. My uninformed guess is that the phrase looks for the variable in the wrong place and just grabs a word.

Regardless, this is an easy mistake for an author to make. Attempting to access a property as if it was a global variable should probably give a warning.

Steps to reproduce :

Jane is a woman. Jane has a truth state called x. X is false.
Check jumping when x is true: say "How peculiar!".
[Check jumping when x of Jane is false: say "Fixed."]

There is a room. Test me with "jump".

Additional information :

imported from: [Mantis 2072] Truth state properties accessed without specifier ("the x" rather than "the x of [thing]) always return true
  • status: Reported
  • resolution: Open
  • resolved: 2022-04-07T05:02:41+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

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

Comment by zarf :
This is definitely a bug, and it occurs for any property type. A more general test case:


Jane is a woman.
Jane has a truth state called x.
Jane has a text called y.

When play begins:
if x is true:
say "Peculiar 1.";
if y is "yyy":
say "Peculiar 2.";

The generated I6 code looks like:


! [2: if x is true]
if ((((p15_x && true) == (1 && true))))

{! [3: say ~Peculiar 1.~]

say__p=1;! [4: ~Peculiar 1.~] ParaContent(); print "Peculiar 1."; new_line; .L_Say1; .L_SayX1;}

! [5: if y is ~yyy~]
if (((p16_y == TX_L_45)))

{! [6: say ~Peculiar 2.~]

say__p=1;! [7: ~Peculiar 2.~] ParaContent(); print "Peculiar 2."; new_line; .L_Say2; .L_SayX2;}

rfalse;

The property constants p15_x and p16_y are being used nonsensically.

curiousdannii-testing commented 2 years ago

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

Comment by zarf :
Interestingly, the expressions are being type-checked. That is, if you test "if y is true", you get:

In the sentence 'if y is true' , it looks as if you intend 'y is true' to be a condition, but that would mean comparing two kinds of value which cannot mix - a texts valued property and a truth state - so this must be incorrect.

So I guess it's incorrectly allowing "texts valued property" to mix with "text".