Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000366Core InformKinds and type checkingpublic2010-10-28 15:082014-05-07 07:35
ReporterEmacsUser 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.4
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000366: Compiler accepts modifications to constant lists and other putative r-values
DescriptionThe attached source compiles, surprisingly.
Minimal Source Text To Reproduce
There is a room.
When play begins:
	add zero to {}.
TagsNo tags attached.
Effect(mild) Compiler accepts invalid code
Attached Files

- Relationships
related to 0001004closedgraham Compiler accepts modifications to r-values resulting from implicit casts 
related to 0001097closedgraham Internal error incrementing a relation 

-  Notes
(0000758)
jmcgrew (administrator)
2010-10-30 21:05
edited on: 2010-10-30 21:05

This is legal according to the definitions of "add" and such, but it leads to strange runtime behavior when the phrase containing the list is reused:

<code>
Home is a room.
Every turn, remove 2 from {1, 2, 3}.
Test me with "z / z".
</code>

<output>
>[1] z
Time passes.

>[2] z
Time passes.

*** Couldn't remove: the value 2 was not present in the list {1, 3} ***

*** Run-time problem P50: Attempt to use list item which does not exist.
</output>

(0001454)
EmacsUser (manager)
2011-11-11 10:22

On the other hand, increment and decrement have an l-value check, but at the expense of type safety:

- - - -
There is a room.
When play begins:
    let x be "foo";
    increment x;
    showme x.
- - - -
(0002243)
graham (administrator)
2014-01-04 09:48

Fixed, and a number of related R-value modifications for other list or text alterations.

- Issue History
Date Modified Username Field Change
2010-10-28 15:08 EmacsUser New Issue
2010-10-30 21:05 jmcgrew Note Added: 0000758
2010-10-30 21:05 jmcgrew Status new => confirmed
2010-10-30 21:05 jmcgrew Note Edited: 0000758 View Revisions
2011-11-11 10:22 EmacsUser Note Added: 0001454
2011-11-11 10:22 EmacsUser Category Lists => Kinds and type checking
2011-11-11 10:22 EmacsUser Summary Compiler accepts modifications to constant lists => Compiler accepts modifications to constant lists and other putative r-values
2012-09-19 16:39 EmacsUser Issue cloned 0001004
2012-09-19 16:39 EmacsUser Relationship added related to 0001004
2013-04-06 18:55 EmacsUser Relationship added related to 0001097
2014-01-04 09:48 graham Note Added: 0002243
2014-01-04 09:48 graham Status confirmed => resolved
2014-01-04 09:48 graham Resolution open => fixed
2014-01-04 09:48 graham Assigned To => graham
2014-05-07 07:34 jmcgrew Fixed in Version => 6L02
2014-05-07 07:35 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker