MantisBT - Core Inform
View Issue Details
0000809Core InformSource text and punctuationpublic2011-11-30 08:122014-05-07 07:34
(critical) Inform 6 compiler reports errors for valid code
0000809: I7 not escaped in RTP_WRONGASSIGNEDKIND messages
The attached source is translated to I6 lines including

- - - -
if (~~((Global_Vars-->9) ofclass K8_person)) RunTimeProblem(RTP_WRONGASSIGNEDKIND, (Global_Vars-->9), "now the target is foo """, "person");
- - - -

where the I7 quotes have not undergone the usual escaping to tildes. The error message:

- - - -
# Error: Missing operator: inserting '+'
> (Global_Vars-->9) = (PHR_740_r3 (EMPTY_TEXT_VALUE)); if (~~(( ...etc
- - - -
There is a room.
The target is a person that varies.
To decide what object is foo (X - some text):
decide on yourself.
When play begins:
now the target is foo "".
No tags attached.
related to 0000129closed graham Missing run-time type check assigning from a supertype to a subtype 
rar Bug809.rar (4,069) 2011-12-05 10:40
Issue History
2011-11-30 08:12TexterNew Issue
2011-12-02 15:40EmacsUserNote Added: 0001472
2011-12-02 15:40EmacsUserPriorityhigh => normal
2011-12-02 15:40EmacsUserStatusnew => feedback
2011-12-04 08:24TexterNote Added: 0001473
2011-12-04 08:24TexterStatusfeedback => new
2011-12-04 19:37EmacsUserNote Added: 0001474
2011-12-04 19:37EmacsUserStatusnew => feedback
2011-12-04 19:38EmacsUserNote Edited: 0001474bug_revision_view_page.php?bugnote_id=0001474#r595
2011-12-05 00:42TexterIssue Monitored: Texter
2011-12-05 00:42TexterIssue End Monitor: Texter
2011-12-05 00:44TexterIssue Monitored: Texter
2011-12-05 00:44TexterIssue End Monitor: Texter
2011-12-05 01:16TexterNote Added: 0001475
2011-12-05 01:16TexterStatusfeedback => new
2011-12-05 04:29TexterNote Edited: 0001475bug_revision_view_page.php?bugnote_id=0001475#r597
2011-12-05 10:40jmcgrewFile Added: Bug809.rar
2011-12-07 09:40TexterNote Edited: 0001475bug_revision_view_page.php?bugnote_id=0001475#r598
2011-12-07 09:57EmacsUserNote Added: 0001477
2011-12-07 09:57EmacsUserStatusnew => confirmed
2011-12-07 09:57EmacsUserCategoryPhrases and functional programming => Kinds and type checking
2011-12-07 09:57EmacsUserSummary(Global_Vars-->25) = (PHR_923_r24 ((Global_Vars-->26),(Glo ...etc => I7 not escaped in RTP_WRONGASSIGNEDKIND messages
2011-12-07 09:57EmacsUserDescription Updatedbug_revision_view_page.php?rev_id=600#r600
2011-12-07 09:57EmacsUserSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=602#r602
2011-12-07 09:57EmacsUserRelationship addedrelated to 0000129
2011-12-07 10:14TexterNote Added: 0001478
2011-12-17 12:37grahamNote Added: 0001495
2011-12-17 12:37grahamStatusconfirmed => resolved
2011-12-17 12:37grahamResolutionopen => fixed
2011-12-17 12:37grahamAssigned To => graham
2013-02-08 20:05EmacsUserIssue cloned0001077
2013-02-08 20:06EmacsUserCategoryKinds and type checking => Source text and punctuation
2014-05-07 07:34jmcgrewFixed in Version => 6L02
2014-05-07 07:34jmcgrewStatusresolved => closed

2011-12-02 15:40   
After expanding the attached source to a full story:

- - - -
There is a room.

A sceneryassist is a kind of backdrop. There are 100 sceneryassists.

The unformed scenery list is a list of objects that varies.

First when play begins (this is the scenery initialization rule):
    now the unformed scenery list is the list of sceneryassists.
To decide which object is a new sceneryobject:
    let selected be entry 1 in unformed scenery list;
    remove selected from unformed scenery list;
    decide on selected.

When play begins:
    let new scenery be a new sceneryobject.
- - - -

I cannot reproduce the error. Could you check whether some of the elided lines are relevant?
2011-12-04 08:24   
This phrase is very long and consists of 52 lines and is very puzzeling, so I can't post it completely. I thought that lines could be helpful. Maybe someone could explain, what the error text does mean.
2011-12-04 19:37   
(edited on: 2011-12-04 19:38)
The error message means that, where one I6 value was expected, Inform's I7-to-I6 transformation has given two, and there is nothing to combine them. But what those two values are we cannot tell without the full text after ``> (Global_Vars-->25)''. And as for why they ended up where they did, we will probably need the long and puzzling phrase, or at least a simplified version that still gives the error. A long post would be okay. Or, if you would like, it might be easier to copy-paste the problematic code to a new story, check that the error message is the same, zip that story, and send it to with ``Bug 809'' mentioned in the subject. We can also mark the issue as private if you want; then only the Inform developers, the site admins, you, and I could see it.

2011-12-05 01:16   
(edited on: 2011-12-07 09:40)
I've abbreviated the source text and I will send it immediately to that email. I don't think it will be necessary to switch the status to private because it doesn't contain any secret information.

2011-12-07 09:57   
Got it. Thanks. The bug in your case is triggered by literal text in an assignment of a new room to a variable whose kind is more specific than object. A couple of workarounds for you:

Instead of

- - - -
now new room is a newly created positioned room dir of current room with name "";
- - - -

store the literal text in a temporary named value, so that it appears on a different line:

- - - -
let the room name be "";
now new room is a newly created positioned room dir of current room with name the room name;
- - - -

or store the new room in a temporary named value, which will have the implicit type object, and then copy it to the global variable:

- - - -
let the temporary room be a newly created positioned room dir of current room with name "";
now the new room is the temporary room;
- - - -
2011-12-07 10:14   
Thank you very much for your help :-) I need to fix some more bugs but I think I will manage it at my own.
2011-12-17 12:37   
Fixed; the summary was perfectly correct about the cause.