curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-2066] [Mantis 2103] Condition code generated as self == self #18

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : nightpool

Description :

I managed to write a condition, "if the number of things the actor is touching is greater than the number of arms of the actor" that Inform compiled into i6 as (self == self). "The number of arms" is a property of people, and "touching" is a various-to-various relation. A minimal reproduction is attached.

I was able, after consulting with a friend, to rewrite the condition into "if the number of things touched by the actor is the number of arms of the actor:" but I believe the original statement should either work or be a parser error—the current behavior, always being true, seems like a pretty definite bug.

Steps to reproduce :

"2019-07-08 cond bug" by nightpool

The Example room is a room. In the example room is a candle, a book, and a bell.

A person has a number called the number of arms. The number of arms of a person is usually two.

Touching relates various people to various things. The verb to touch means the touching relation.

Carry out an actor touching: now the actor touches the noun.
Check an actor touching (this is the can't touch more things then hands rule):
    [if the number of things touched by the actor is the number of arms of the actor:]
    if the number of things the actor is touching is greater than the number of arms of the actor:
        If the actor is the player, say "You only have [number of arms of the actor] hands! You're currently touching [(list of things that the actor relates to by the touching relation) with definite articles]";
        stop the action.

test me with "touch the candle / touch the bell / touch the book / relations"

Additional information :

This is the snippet of relevant i6 output:

! [2: if the number of things the actor is touching is greater than the number of arms of the actor]
if (((self == self)))

P.S. If anyone knows a better way to write "[(list of things that the actor relates to by the touching relation) with definite articles]", I'm all ears, the current phrasing seems very clunky to me.

imported from: [Mantis 2103] Condition code generated as self == self
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-10T04:36:37+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

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

Comment by zarf :
I believe the problem is that "the number of things the actor is touching" is not a meaningful expression. The compiler must be going down some garden path trying to parse it.

curiousdannii-testing commented 2 years ago

61eedb62875fc10070240916:

Now generates a sensible problem message.