curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1539] [Mantis 1575] Slightly misleading error message on bad list index #545

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : dfremont

Description :

The Problem message which results from indexing into a list with a value that is not a number identifies the wrong part of the source text as being the issue. In the example below, the blame is placed on the new name "E" (the error message is otherwise correct, saying that the index is not a number).

Steps to reproduce :

Foo is a room.
When play begins: let E be entry Foo of {1, 2, 3}.

Additional information :

The full Problem message:

Problem. You wrote 'let E be entry Foo of

{1, 2, 3}

' : but that doesn't make sense to me as a list entry, because the indication of which entry is not a number. For instance, 'entry 3 of L' is allowed, but not 'entry "six" of L'. (List entries are numbered 1, 2, 3, ...)
I was trying to match one of these phrases:

1. let (e - a new name) be (entry foo of

{ 1 , 2 , 3 } - description of relations of values)

  1. let (e - a new name) be (entry foo of { 1 , 2 , 3 }

    - name of kind)

  2. let (e - a new name) be (entry foo of { 1 , 2 , 3 } - value)

  3. let (e - a temporary named value) be (entry foo of { 1 , 2 , 3 }

    - value)
    I recognised:

entry foo of

{ 1 , 2 , 3 }

= a list entry, holding a number
But I didn't recognise 'e'.

imported from: [Mantis 1575] Slightly misleading error message on bad list index
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-07T04:59:14+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

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

Comment by graham :
This is pretty marginal, because in fact Inform is saying something meaningful and correct here, but I've improved the wording to take away any ambiguity.