Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000904Core InformKinds and type checkingpublic2012-04-07 22:012014-05-07 07:33
ReporterNYKevin 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSLinuxOS VersionAny
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000904: Generic phrases can be instantiated with indefinite kinds
DescriptionI (EmacsUser) am going to be pushy on this one and reopen it with the variant source text from the comments. In that source, Q is given the kind ``list of values'', a kind normally forbidden by Inform as too vague (see the commented line about Baz). It then proceeds to add values of different kinds to that list, and the instruction ``add Q to L'' consequently produces runtime errors:

- - - -
*** Deep copy failed: source empty ***
*** Deep copy failed: types mismatch ***
- - - -

The prior resolution was ``no change required''. But surely it must be a bug if Inform produces code violating its own type checks.
Minimal Source Text To Reproduce
There is a room.
When play begins:
	showme Foo {{1}} bar {};
To decide which K is foo (L - a value of kind K) bar (Q - a value of kind Z):
	add 0 to Q;
	add "" to Q;
	add Q to L;
	decide on L.
[Baz is a list of values that varies.]
TagsNo tags attached.
Effect(mild) Compiler accepts invalid code
Attached Files

- Relationships
related to 0000648closedgraham Property names typecast to a number and back again can not be typed 
related to 0000905closedgraham Compiler assumes one interpretation for ambiguous source text 
has duplicate 0000903closed Ambigous generic phrases can produce error about '<no text>' 

-  Notes
(0001656)
EmacsUser (manager)
2012-04-12 13:50
edited on: 2012-06-21 17:21

As in 0000648, this source code here uses a value with an indefinite kind to instantiate a generic phrase. ({} is only known to be a list of values; similarly, I6 inclusions in 0000648 are used to create values that are only known to be properties.) In consequence, Q has an unfortunately versatile type:

- - - -
There is a room.
When play begins:
    showme Foo {{1}} bar {};
To decide which K is foo (L - a value of kind K) bar (Q - a value of kind Z):
    add 0 to Q;
    add "" to Q;
    add Q to L;
    decide on L.
- - - -

I'll split off the bug for accepting ambiguous source text.

(0002382)
graham (administrator)
2014-01-26 08:52

This looks correct to me, and Inform seems to be correctly deciding which sense of "add Q to L" to apply.
(0002423)
graham (administrator)
2014-02-01 08:43

Yes, I now understand. I agree that the new minimal source text should be illegal, and Inform now rejects the invocation "showme Foo {{1}} bar {}" with a problem message.

- Issue History
Date Modified Username Field Change
2012-04-07 22:01 NYKevin New Issue
2012-04-12 13:42 EmacsUser Relationship added has duplicate 0000903
2012-04-12 13:50 EmacsUser Note Added: 0001656
2012-04-12 13:50 EmacsUser Reproducibility have not tried => always
2012-04-12 13:50 EmacsUser Status new => confirmed
2012-04-12 13:50 EmacsUser Summary Inform accepts ambiguous generic phrases involving the empty list => Generic phrases can be instantiated with indefinite kinds
2012-04-12 13:50 EmacsUser Relationship added related to 0000648
2012-04-12 13:55 EmacsUser Issue cloned 0000905
2012-04-12 13:55 EmacsUser Relationship added related to 0000905
2012-06-21 17:21 EmacsUser Note Edited: 0001656 View Revisions
2012-07-01 11:46 EmacsUser Relationship replaced child of 0000905
2012-07-01 11:48 EmacsUser Relationship replaced related to 0000905
2014-01-26 08:52 graham Note Added: 0002382
2014-01-26 08:52 graham Status confirmed => resolved
2014-01-26 08:52 graham Resolution open => no change required
2014-01-26 08:52 graham Assigned To => graham
2014-01-26 19:28 EmacsUser Status resolved => new
2014-01-26 19:28 EmacsUser Resolution no change required => reopened
2014-01-26 19:28 EmacsUser Description Updated View Revisions
2014-01-26 19:28 EmacsUser Steps to Reproduce Updated View Revisions
2014-01-26 19:28 EmacsUser Additional Information Updated View Revisions
2014-01-26 19:34 EmacsUser Status new => assigned
2014-01-26 19:34 EmacsUser Description Updated View Revisions
2014-01-26 19:34 EmacsUser Assigned To graham =>
2014-01-26 19:34 EmacsUser Status assigned => new
2014-02-01 08:43 graham Note Added: 0002423
2014-02-01 08:43 graham Status new => resolved
2014-02-01 08:43 graham Resolution reopened => fixed
2014-02-01 08:43 graham Assigned To => graham
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker