curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1428] [Mantis 1464] A top-level action declaration with variables generates invalid I6 code #656

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : zarf

Description :

The table entry "(action of) the player examining the desk" generates a compile-time block entry

Array BC_178 --> 0 (101449728) STORED_ACTION_TY MAX_POSITIVE_NUMBER ##Examine I125_desk 0 player 0 0;

This doesn't compile because "player" is a global variable.

It looks like actions in table entries (and other compile-time stored-action declarations) must not have variables. The compiler should detect this and complain. For the particular case of "the player" in an action, it might suggest leaving the argument off ("examining the desk") or replacing it with "yourself".

(In a rule body, "the action of the player examining the desk" is legal because the variables are immediately resolved to constants, e.g. "yourself".)

Steps to reproduce :

The Kitchen is a room.

The desk is in the Kitchen.

Steve is a person.

Table of Test Actions
Commands
examining the desk
Steve examining the desk
the player examining the desk

Additional information :

imported from: [Mantis 1464] A top-level action declaration with variables generates invalid I6 code
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-07T04:58:23+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

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

Comment by graham :
Fixed; there's now a fairly helpful problem message.