MantisBT - Core Inform
View Issue Details
0000080Core InformRelationspublic2010-06-21 00:322010-10-28 00:30
jmcgrew 
graham 
normalmildalways
closedfixed 
x86Windows7
6E59 
6F95 
(mild) Compiler accepts invalid code
0000080: Untyped relations are allowed but can't be used safely
Inform accepts "relation" or "relation of values to values" as the type of a global variable or property, but such a generic type breaks type safety (and is forbidden as the type of a local variable). The code below stores indexed text and numbers in the same domain, but the indexed text is treated as a number when printed.
Home is a room.

Foo is a relation that varies.
A thing has a relation of values to values called bar.

When play begins:
let X be indexed text;
let X be "grunk";
now foo relates 4 to X;
show relation foo.
The indexed text can still be pulled out with "the indexed text to which 4 relates by foo", but since the relation code doesn't know which values are block type, its lifetime won't be managed reliably when the relation is modified.

"list of values" is already forbidden as the type of a variable or property.
No tags attached.
Issue History
2010-06-21 00:32jmcgrewNew Issue
2010-06-21 00:32jmcgrewStatusnew => acknowledged
2010-06-21 10:25jmcgrewAdditional Information Updatedbug_revision_view_page.php?rev_id=57#r57
2010-06-21 12:27EmacsUserStatusacknowledged => confirmed
2010-09-29 01:52grahamNote Added: 0000611
2010-09-29 01:52grahamStatusconfirmed => resolved
2010-09-29 01:52grahamResolutionopen => fixed
2010-09-29 01:52grahamAssigned To => graham
2010-10-25 21:14jmcgrewFixed in Version => 6F95
2010-10-28 00:30jmcgrewStatusresolved => closed

Notes
(0000611)
graham   
2010-09-29 01:52   
I have finally sorted this out, and generally improved the problem messages in this area.