Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001080Core InformPhrases and functional programmingpublic2013-02-15 10:442014-05-07 07:33
ReporterEmacsUser 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0001080: General phrase overrides specific one if it appears later in the source text
DescriptionQuoting my comment 0001079:0001975, ``It looks like Inform chooses [to treat a new phrase definition as an overload] whenever two phrases' wordings match exactly and, comparing corresponding argument descriptions by the most specific kinds they imply, the kinds from the new phrase are subkinds of those from the old one.''

As a consequence of the way that test is set up, the second phrase in the attached source is not considered an overload. Then, by 0000905, the story always prints ``Person'', contrary to point 1 in WI 21.9.
Minimal Source Text To Reproduce
There is a room.
To foo (X - a person):
	say "Person."
To foo (X - a thing):
	say "Thing."
Bar is a thing.
When play begins:
	repeat with a counter running from one to ten:
		foo a random thing.
Additional InformationThe relevant I6:
- - - -
         ! [2: foo a random thing]
         (PHR_742_r3 ( (Prop_0()) ));
- - - -
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0001079closedgraham Phrase overloading doesn't support different "decide what" kinds 

-  Notes
(0001977)
curiousdannii (developer)
2013-02-15 17:24
edited on: 2013-02-15 17:27

It feels like this is related to 0000686 test case 2.

I also wonder if it's related to the second test case in 0000830:0001690.

Lastly if you give two phrases the exact same definition, then one will be used without any compiler message at all. If the two phrases are in extensions, if you change the order the extensions are included then which phrase is used will change without any indication to the author of what is really happening.

(0001978)
zarf (developer)
2013-02-15 21:56

Redefining a phrase (using the same phrasing, arguments, and return type) is a common case for customizing some behavior of the Standard Rules. The compiler uses the last definition (as far as I know) to support that.
(0002475)
graham (administrator)
2014-02-10 16:40

This was actually not to do with the sequence in the source text, but was a race condition bug in the kind-checker, now fixed.

- Issue History
Date Modified Username Field Change
2013-02-15 10:44 EmacsUser New Issue
2013-02-15 10:44 EmacsUser Relationship added related to 0001079
2013-02-15 17:04 curiousdannii Status new => confirmed
2013-02-15 17:04 curiousdannii Steps to Reproduce Updated View Revisions
2013-02-15 17:24 curiousdannii Note Added: 0001977
2013-02-15 17:26 curiousdannii Note Edited: 0001977 View Revisions
2013-02-15 17:27 curiousdannii Note Edited: 0001977 View Revisions
2013-02-15 21:56 zarf Note Added: 0001978
2014-02-10 16:40 graham Note Added: 0002475
2014-02-10 16:40 graham Status confirmed => resolved
2014-02-10 16:40 graham Resolution open => fixed
2014-02-10 16:40 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