|Anonymous | Login | Signup for a new account||2018-07-18 03:47 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001080||Core Inform||Phrases and functional programming||public||2013-02-15 10:44||2014-05-07 07:33|
|Platform||x86||OS||Mac OS X||OS Version||10.6|
|Target Version||Fixed in Version||6L02|
|Summary||0001080: General phrase overrides specific one if it appears later in the source text|
|Description||Quoting 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 Information||The relevant I6:|
- - - -
! [2: foo a random thing]
(PHR_742_r3 ( (Prop_0()) ));
- - - -
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
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.
|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.|
|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.|
|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|