|View Issue Details [ Jump to Notes ] ||[ Issue History ] [ Print ] |
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000080||Core Inform||Relations||public||2010-06-21 00:32||2010-10-28 00:30|
|Assigned To||graham|| |
|Product Version||6E59|| |
|Target Version||Fixed in Version||6F95|| |
|Summary||0000080: Untyped relations are allowed but can't be used safely|
|Description||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.|
|Minimal Source Text To Reproduce|
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.
|Additional Information||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.
|Tags||No tags attached.|
|Effect||(mild) Compiler accepts invalid code|