Re: Type inference oddity with this_program
Henrik Grubbström <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Organization | Roxen Internet Software AB |
| Message-ID | <[email protected]> |
On Tue, 8 Apr 2014, Chris Angelico wrote: > Example code: [...] > This produces the following error: > > thisprog.pike:8:Indexing on illegal type. > thisprog.pike:8:Got : function( : object(is > program(/home/rosuav/thisprog.pike))). > thisprog.pike:8:Index : string. > Pike: Failed to compile script. > > If the program is retained in a separate variable (see the > commented-out alternative), it works fine, and correctly fetches up > the value of the constant. Using this[const] also works fine. But > this_program[const], for some reason, is thought to be looking at a > function (which it kinda is; calling a program will return an object > of that type, so the signature is more-or-less right). > > This oddity is visible on Pike 7.8.700 on Windows and 8.0.1 on Linux. > > Is this a bug, or am I misunderstanding this_program? It was a bug, and it is now fixed in Pike 8.0. > ChrisA Thanks for the report. -- Henrik Grubbström [email protected] Roxen Internet Software AB